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.

  • 相关阅读:
    HO引擎近况20210912
    查询超时问题的处理
    ubuntu根据关键词批量杀进程
    创建notebook适用的虚拟环境
    信赖域策略优化(Trust Region Policy Optimization, TRPO)
    强化学习(Reinforcement Learning)
    生成对抗网络(GAN与W-GAN)
    卷积神经网络CNN
    循环神经网络RNN
    PyTorch自动求导
  • 原文地址:https://www.cnblogs.com/grj1046/p/14252143.html
Copyright © 2011-2022 走看看