Difference between revisions of "Go: Hello world! example"

From wikieduonline
Jump to navigation Jump to search
(Created page with "==Hello world== touch hello_world.go <pre> package main import "fmt" func main() { fmt.Println("Hello, world!") } </pre> where "fmt" is the package for ''formatte...")
 
Line 22: Line 22:
 
== See also ==
 
== See also ==
 
* {{go}}
 
* {{go}}
 +
 +
[[Category:Programming]]

Revision as of 08:13, 29 April 2020

Hello world

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

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