zoukankan      html  css  js  c++  java
  • Golang 加速 Go module 加速 Goproxy

    Goproxy China

    The most trusted Go module proxy in China.

    https://goproxy.cn

    Go 1.13 and above (RECOMMENDED)

    Open your terminal and execute

    $ go env -w GO111MODULE=on
    $ go env -w GOPROXY=https://goproxy.cn,direct
    

    done.

    macOS or Linux

    Open your terminal and execute

    $ export GO111MODULE=on
    $ export GOPROXY=https://goproxy.cn
    

    or

    $ echo "export GO111MODULE=on" >> ~/.profile
    $ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
    $ source ~/.profile
    

    done.

    Windows

    Open your terminal and execute

    C:> $env:GO111MODULE = "on"
    C:> $env:GOPROXY = "https://goproxy.cn"
    

    or

    1. Open the Start Search, type in "env"
    2. Choose the "Edit the system environment variables"
    3. Click the "Environment Variables…" button
    4. Under the "User variables for <YOUR_USERNAME>" section (the upper half)
    5. Click the "New..." button
    6. Choose the "Variable name" input bar, type in "GO111MODULE"
    7. Choose the "Variable value" input bar, type in "on"
    8. Click the "OK" button
    9. Click the "New..." button
    10. Choose the "Variable name" input bar, type in "GOPROXY"
    11. Choose the "Variable value" input bar, type in "https://goproxy.cn"
    12. Click the "OK" button
    

    done.


    goproxy.io

    https://goproxy.io

    A Global Proxy for Go Modules

    go env -w GO111MODULE=on
    go env -w GOPROXY="https://goproxy.io,direct"
    
    # Set environment variable allow bypassing the proxy for selected modules (optional)
    go env -w GOPRIVATE="*.corp.example.com"
    
    # Set environment variable allow bypassing the proxy for specified organizations (optional)
    go env -w GOPRIVATE="example.com/org_name"
    

    Now, when you build your applications, Go will fetch dependencies via goproxy.io. See more information in the doc and how to use Private service.

    Go version <= 1.12

    Bash (Linux or macOS)

    # Enable the go modules feature
    export GO111MODULE="on"
    # Set the GOPROXY environment variable
    export GOPROXY="https://goproxy.io"
    

    Or, write it into the .profile or .bash_profile file.

    PowerShell (Windows)

    # Enable the go modules feature
    $env:GO111MODULE="on"
    # Set the GOPROXY environment variable
    $env:GOPROXY="https://goproxy.io"
    

    Now, when you build your applications, Go will fetch dependencies via goproxy.io. See more information in the doc.

  • 相关阅读:
    取石子(五)(FIB博弈)
    NYOJ-161-取石子 (四)(Wythoff 博弈)
    memcached简介
    RSA---应用最广泛的非对称加密算法
    分区
    按子组收集数据
    多级分组
    归约和汇总
    收集器Collectors
    由函数生成流---创建无限流:Stream.iterate和Stream.generate
  • 原文地址:https://www.cnblogs.com/grj1046/p/14252143.html
Copyright © 2011-2022 走看看