go get -v golang.org/x/tools/cmd/goimports // timeout
1149 # 启用 Go Modules 功能
1150 export GO111MODULE=on
1151 # 配置 GOPROXY 环境变量
export GO111MODULE=on
export GOPROXY=https://goproxy.io
// go option test
推荐:blog: Go工具和调试详解
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
// See page 1.
// Helloworld is our first Go program.
//!+
package main
import "fmt"
var len = 10
var (
n1 = 1
n2 = 2
)
func main() {
fmt.Println("Hello, 世界")
// single var
var i int
// i = 1.1 // constant 1.1 truncated to integer go
fmt.Println("i =", i)
var j = 10
fmt.Println("j =", j)
k := 10
fmt.Println("k =", k)
// multi var
var n1, n2, n3 int
fmt.Println("n1 =", n1, "n2 =", n2, "n3 =", n3)
m1, m2, m3 := 100, "tom", 999
fmt.Println("m1 =", m1, "m2 =", m2, "m3 =", m3)
var len = 20
fmt.Println("len =", len)
fmt.Printf("len`s type is %T", len) // show type
}
//!-