Start

# Settings for Golang
export GOROOT=/usr/local/go  # golang binary distribution
export GOPATH=$HOME/go       # packages
export PATH=$GOPATH/bin:$PATH
type MyInt int
type MyString string
package main

import "fmt"

type SomeStruct struct {
	i int
	c rune
	s string
}

func main() {
  s := SomeStruct{97, 'b', "text"}
  fmt.Printf("%v\n%+v\n%#v\n%q\n\n", s, s, s, s)

	v := 42
	fmt.Printf("v is of type %T\n", v)
}

// output:
/*
%v:  {97 98 text}
%+v: {i:97 c:98 s:text}
%#v: main.SomeStruct{i:97, c:98, s:"text"}
%q:  {'a' 'b' "text"}

v is of type int
*/
fmt.Println("abc", "def", "ghi")
// output:
// abc def ghi
// import "strconv"
a := strconv.Itoa(23)
package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    reader := bufio.NewReader(os.Stdin)
    fmt.Print("Enter your city: ")
    city, _ := reader.ReadString('\n')
    fmt.Print("You live in " + city)
}

Terminal

method 1:
$ go build hello.go
$ ./hello

method 2:
$ go run hello.go