Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 518 Bytes

hello-world-example.md

File metadata and controls

31 lines (24 loc) · 518 Bytes

Hello world example

package main
import "fmt"

func main() {
  fmt.Println("Hello world")
}
  • package main - default package declaration
  • import "fmt" - loads fmt package to operate on strings (and print them)
  • func main() { - declare main function that will be launched automatically
  • fmt.Println - prints specified string
  • "Hello world" - string to print

Example:

package main
import "fmt"

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