xxxxxxxxxx
//Hello World! in Go
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
xxxxxxxxxx
//- copyright -----
//---© samoraje ---
//-----------------
// golang hello world script
package main
import "fmt"
func main(){
fmt.Print"Hello World!"
}
xxxxxxxxxx
// First Go program
package main
import "fmt"
// Main function
func main() {
fmt.Println("!... Hello World ...!")
}
xxxxxxxxxx
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
$ go run hello-world.go
hello world
$ go build hello-world.go
$ ls
hello-world hello-world.go
$ ./hello-world
hello world
xxxxxxxxxx
//first add the package main
package main // package declaration
import "fmt" // import keyword is used to import packages in your program and
// fmt package is used to implement formatted Input/Output with functions.
func main() {
//Print Hello World
fmt.Println("Hello World")
}