• gopl


    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
    }
    
    //!-
  • 相关阅读:
    几种任务调度的 Java 实现方法与比较
    nginx配置
    生产消费_lock和阻塞队列
    阻塞队列
    countdownlatch+cyclicbarrier+semphore
    01背包
    skiplist
    lru
    按序打印_lock和condition
    按序打印_volatile 无法保证顺序
  • 原文地址:https://www.cnblogs.com/cjyp/p/13687593.html
Copyright © 2020-2023  润新知