go语言import时为什么都从github导入

Python013

go语言import时为什么都从github导入,第1张

go/src/go-cve-dictionary-master

# mv subcommands-master /opt/go/src/subcommands

# mv net-master /opt/go/src/net

# mv go-sqlite3-master /opt/go/src/go-sqlite3

都放到了go/src目录下了,我还修改了go-cve-dictionary-master/main.go文件内容,如下所示:

import (

"flag"

"fmt"

"os"

"golang.org/x/net/context"改为 逗context地

"github.com/google/subcommands" 改为 subcommands

"github.com/kotakanbe/go-cve-dictionary/commands" 改为 go-cve-dictionary/commands

"github.com/kotakanbe/go-cve-dictionary/version" 改为 go-cve-dictionary/version

_ "github.com/mattn/go-sqlite3" 改为 go-sqlite3

)

执行 # go install go-cve-dictionary-master 错误如下:

can't load package: /opt/go/src/go-cve-dictionary-master/main.go:14:2: non-standard import "github.com/mattn/go-sqlite3" in standard package "go-cve-dictionary-master"

go-cve-dictionary-master/main.go:11:2: cannot find package "go-cve-dictionary/commands" in any of:

/opt/go/src/vendor/go-cve-dictionary/commands (vendor tree)

/opt/go/src/go-cve-dictionary/commands (from $GOROOT)

/root/go/src/go-cve-dictionary/commands (from $GOPATH)

go-cve-dictionary-master/main.go:12:2: cannot find package "go-cve-dictionary/version" in any of:

/opt/go/src/vendor/go-cve-dictionary/version (vendor tree)

/opt/go/src/go-cve-dictionary/version (from $GOROOT)

/root/go/src/go-cve-dictionary/version (from $GOPATH)

subcommands/subcommands.go:29:2: cannot find package "golang.org/x/net/context" in any of:

/opt/go/src/vendor/golang.org/x/net/context (vendor tree)

/opt/go/src/golang.org/x/net/context (from $GOROOT)

/root/go/src/golang.org/x/net/context (from $GOPATH

Golang下的命令行色彩使用库, 拥有丰富的色彩渲染输出,通用的API方法,兼容Windows系统

仓库名称 :color

标星(star) :221 (不错哦,潜力股项目)

标星趋势

拷贝(fork) :21

贡献人数 :3

仓库大小 :1 MB

主要开发语言:Go

语言分布:Go:99.75%、Batchfile:0.25%

代码提交周期分布

作者动态

2星

Golang下的命令行色彩使用库, 拥有丰富的色彩渲染输出,通用的API方法,兼容Windows系统

功能特色

https://github.com/gookit/color

程序员新视界:分享有趣、有料的程序员话题,每天进步一点点。