Anatomy of a Go Program
Every Go file follows a specific structure:
- Package Declaration:
package maintells Go this is an executable. - Imports: Bringing in external or standard library code.
- Main Function:
func main()is the entry point.
go package main
import "fmt"
func main() { fmt.Println("Cloud-Native Go!") }
Run it with go run main.go.