Go/Hello World
From charlesreid1
The hello world has three things you'll need to remember:
- package main
- import fmt
- func main
Here we go:
// hello.go package main import "fmt" func main() { fmt.Println("hello world") }
Now we run the program directly:
$ go run hello-world.go hello world
or, use an intermediate compilation step:
$ go build hello-world.go $ ls hello-world hello-world.go $ ./hello-world hello world
Flags
Go notes on Go
Go/Strings · Go/Arrays · Go/Slices
Go/Lists · Go/Maps · Go/Stacks · Go/Queues
Go/Naming Conventions · Go/Design Patterns
Go/Timing · Go/Profiling · Go/Benchmarking
Go/Tests · Go/Travis CI · Go/Makefiles
our vim + go setup uses custom solarized colors for Golang
|