Comment on page
Structure
- Documentation block
- Preprocessor Statements
- The main ( ) function
- Local Variable Declarations
- Program statements
- User defined functions
/* This is my first Go program. */
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
/*
Program Name: First Go Program
Version: 1.0
Description: Go program basic program structure.
Author: @Oliver
Date Created 04/01/2021
*/
package main
import "fmt"
Mandatory to have in Go.
Variables in main
This is the section where we place our main logic of the program which included the executable statements, that tell the computer to perform a specification action. Program statement can be an input-output statements, arithmetic statements, control statements, simple assignment statements and any other statements and it also includes comments that are enclosed within /* and */.
Functions in main
Last modified 2yr ago