The first statement in a Go source file must be
package name
. Executable commands must always use
package main
.
If you want to change selection, open document below and click on "Move attachment"
How to Write Go Code - The Go Programming Languageclone it if it already exists in version control. $ cd hello $ go mod init example/user/hello go: creating new go.mod: module example/user/hello $ cat go.mod module example/user/hello go 1.16 $ <span>The first statement in a Go source file must be package name. Executable commands must always use package main. Next, create a file named hello.go inside that directory containing the following Go code: package main import "fmt" func main() { fmt.Println("Hello, world.") } Now you can build and i Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details