Go: Hello world! example

From wikieduonline
Revision as of 20:08, 10 December 2021 by Welcome (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Hello world[edit]

touch hello_world.go
package main 

import "fmt" 

func main() {
    fmt.Println("Hello, world!")
}

where "fmt" is the package for formatted I/O, similar to C's C file input/output.[1]


go build hello_world.go
./hello_world
Hello, world!


See also[edit]

  • "fmt - The Go Programming Language". golang.org. Retrieved 2019-04-08.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  • Advertising: