使用go.mod安装go软件包

时间:2019-12-17 03:35:22

标签: go go-modules

我想从源代码安装go软件包, 通常我只是git clone文件,并将其移动到GOPATH中的相应文件夹。 库https://github.com/jackc/pgx 当我下载pgx时,使用go.mod文件并将其移至github.com/jackc 它报告许多错误,例如

  

找不到软件包“ github.com/jackc/pgio”

go.mod

module github.com/jackc/pgx/v4

go 1.12

require (
    github.com/cockroachdb/apd v1.1.0
    github.com/gofrs/uuid v3.2.0+incompatible
    github.com/jackc/pgconn v1.1.0
    github.com/jackc/pgio v1.0.0
    github.com/jackc/pgproto3/v2 v2.0.0
    github.com/jackc/pgtype v1.0.3
    github.com/jackc/puddle v1.0.0
    github.com/mattn/go-colorable v0.1.2 // indirect
    github.com/mattn/go-isatty v0.0.9 // indirect
    github.com/rs/zerolog v1.15.0
    github.com/satori/go.uuid v1.2.0
    github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24
    github.com/sirupsen/logrus v1.4.2
    github.com/stretchr/testify v1.4.0
    go.uber.org/zap v1.10.0
    golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 // indirect
    golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 // indirect
    golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
    gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec
)

我尝试了go mod download,但是没有用,没有下载新软件包。 日志

D:\golib\src\github.com\jackc\pgx>go mod  download
go: finding github.com/cockroachdb/apd v1.1.0
go: finding github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
go: finding github.com/creack/pty v1.1.7
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/go-stack/stack v1.8.0
go: finding github.com/gofrs/uuid v3.2.0+incompatible
go: finding github.com/jackc/chunkreader v1.0.0
go: finding github.com/jackc/chunkreader/v2 v2.0.0
go: finding github.com/jackc/pgconn v1.1.0
go: finding github.com/jackc/pgio v1.0.0
go: finding github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2
go: finding github.com/jackc/pgpassfile v1.0.0
go: finding github.com/jackc/pgproto3 v1.1.0
go: finding github.com/jackc/pgproto3/v2 v2.0.0
go: finding github.com/jackc/pgtype v1.0.3
go: finding github.com/jackc/puddle v1.0.0
go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.2
go: finding github.com/kr/pretty v0.1.0
go: finding github.com/kr/pty v1.1.8
go: finding github.com/kr/text v0.1.0
go: finding github.com/lib/pq v1.2.0
go: finding github.com/mattn/go-colorable v0.1.2
go: finding github.com/mattn/go-isatty v0.0.9
go: finding github.com/pkg/errors v0.8.1
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/rs/xid v1.2.1
go: finding github.com/rs/zerolog v1.15.0
go: finding github.com/satori/go.uuid v1.2.0
go: finding github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24
go: finding github.com/sirupsen/logrus v1.4.2
go: finding github.com/stretchr/objx v0.2.0
go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/zenazn/goji v0.9.0
go: finding go.uber.org/atomic v1.4.0
go: finding go.uber.org/multierr v1.1.0
go: finding go.uber.org/zap v1.10.0
go: finding golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7
go: finding golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
go: finding golang.org/x/text v0.3.2
go: finding golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f
go: finding golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec
go: finding gopkg.in/yaml.v2 v2.2.2

0 个答案:

没有答案