{"id":2377,"date":"2020-06-28T19:07:40","date_gmt":"2020-06-28T13:37:40","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=2377"},"modified":"2020-11-21T12:31:52","modified_gmt":"2020-11-21T07:01:52","slug":"hello-world-golang","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/hello-world-golang\/","title":{"rendered":"Hello World in Go (Golang)"},"content":{"rendered":"\n
<\/p>\n\n\n\n
Let’s see how to write a simple Hello World program in golang. Create a file with an extension .go. Let’s name this file helloworld.go<\/strong>. Below will be the contents of the file.<\/p>\n\n\n\n Some points to note about above program<\/p>\n\n\n\n Let’s run this file now. For running, go to the directory which contains this file. Type below command to run the file. What this command will do is compile the go file and immediately run it.<\/p>\n\n\n\n Output<\/strong><\/p>\n\n\n\n Let’s see how to write a simple Hello World program in golang. Create a file with an extension .go. Let’s name this file helloworld.go. Below will be the contents of the file. Some…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"class_list":["post-2377","post","type-post","status-publish","format-standard","hentry","category-tech"],"yoast_head":"\npackage main \n\nimport \"fmt\" \n\nfunc main() { \n fmt.Println(\"Hello World\") \n}<\/code><\/pre>\n\n\n\n
fmt.Println(\"Hello World\")<\/code><\/pre>\n\n\n\n
go run helloworld.go<\/code><\/pre>\n\n\n\n
Hello World<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"