zoukankan      html  css  js  c++  java
  • go get: zip for github.com/aliyun/aliyun-oss-go-sdk@v2.0.0 has unexpected file github.com/aliyun/aliyun-oss-go-sdk@v0.0.0-20190618055949-e8251f77f2ba/.travis.yml

    如使用 go get 时往往会速度很慢或者压根无法下载下来,如下所示:

    E:gosrccodeBlock>go get github.com/aliyun/aliyun-oss-go-sdk/oss
    go: downloading github.com/aliyun/aliyun-oss-go-sdk v2.0.0
    go get github.com/aliyun/aliyun-oss-go-sdk/oss: zip for github.com/aliyun/aliyun-oss-go-sdk@v2.0.0 has unexpected file github.com/aliyun/aliyun-oss-go-sdk@v0.0.0-20190618055949-e8251f77f2ba/.travis.yml
    

    先查看版本

    go version
    go version go1.12.4 linux/amd64
    

    解决方案

    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"
    

    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"
    

    或者将以上内容写进 .profile 或者 .bash_profile 文件。

    PowerShell (Windows)

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

    参考官网教程: https://goproxy.io/

    下载完后

    运行以下代码:

    package main
    
    import (
    	"fmt"
    
    	"github.com/aliyun/aliyun-oss-go-sdk/oss"
    )
    
    func main() {
    	fmt.Println("OSS Go SDK Version: ", oss.Version)
    }
    

    输出:

    OSS Go SDK Version:  v2.1.2
    
    自知者不怨人,知命者不怨天。
  • 相关阅读:
    最大熵模型
    python安装深度学习包theano,Pylearn2,scikit-neuralnetwork
    sklearn之learningcurve
    sklearn之validationcurve
    SVM
    一年7篇CVPR和4篇ICCV——女神
    CUDA大作业_进行图像特征匹配V2.0
    CUDA大作业_进行图像特征匹配V1.0
    从K近邻算法、距离度量谈到KD树、SIFT+BBF算法
    Ubuntu 开机出现 grub rescue> 终端模式修复方法
  • 原文地址:https://www.cnblogs.com/liqingbo/p/14922737.html
Copyright © 2011-2022 走看看