golang tutorial - golang tutorial - Go Program | Go Programming Language | First Program - golang - go programming language - google go - go language - go program - google language
Go Hello World Example
A Go program will have the following parts:
- Package Declaration
- Import Packages
- Functions
- Variables
- Statements & Expressions
- Comments
Sample code:
How to execute the Go Program:
- Open a text editor and add the above-mentioned code.
- Step 1 : Save the file as hello-world.go
- Step 2 : Open a command prompt and go to the directory where you saved the file.
- Step 3 : Type go run hello.go and press enter to run your code.
- Hello, World! Welcome to Wikitechy
- hello-world hello-world.go
- Hello, World! Welcome to Wikitechy
- Step 4 : You will get the output "Hello, World! Welcome to Wikitechy"