我在一个2人的团队在大学的一个家庭作业中,我们创建了一个从一个公共仓库克隆的github上的私有仓库.我们使用的是GO语言,DOCKER和DOCKER-COMPOSE。GO中所有的导入都来自公共仓库。创建私有仓库的人在尝试构建时没有得到错误,但是我得到了错误,我不能构建它。我用ssh克隆了私有存储库,用ssh-agent转发我的密钥。公共存储库是“github.com/ucy-coast/cs499-fa22“,go模块名称是“github.com/ucy-coast/hotel-app/“。私有存储库是github.com/ucy-coast/username/cs499-fa22。我得到以下消息。
go: finding module for package github.com/sirupsen/logrus
go: finding module for package gopkg.in/mgo.v2
go: finding module for package google.golang.org/grpc/reflection
go: finding module for package golang.org/x/net/context
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/golang/protobuf/proto
go: finding module for package google.golang.org/grpc
go: finding module for package google.golang.org/grpc/credentials/insecure
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/hailocab/go-geoindex
go: finding module for package github.com/uber/jaeger-client-go/config
go: finding module for package github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
go: finding module for package github.com/opentracing/opentracing-go
go: finding module for package google.golang.org/grpc/keepalive
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/opentracing/opentracing-go v1.2.0
go: downloading google.golang.org/grpc v1.50.1
go: downloading github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
go: downloading github.com/sirupsen/logrus v1.9.0
go: downloading github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711
go: downloading golang.org/x/net v0.2.0
go: downloading gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
go: downloading github.com/uber/jaeger-client-go v2.30.0+incompatible
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.9.0
go: found github.com/opentracing/opentracing-go in github.com/opentracing/opentracing-go v1.2.0
go: found github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc in github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
go: found github.com/hailocab/go-geoindex in github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711
go: found google.golang.org/grpc in google.golang.org/grpc v1.50.1
go: found google.golang.org/grpc/keepalive in google.golang.org/grpc v1.50.1
go: found google.golang.org/grpc/reflection in google.golang.org/grpc v1.50.1
go: found github.com/golang/protobuf/proto in github.com/golang/protobuf v1.5.2
go: found golang.org/x/net/context in golang.org/x/net v0.2.0
go: found google.golang.org/grpc/credentials/insecure in google.golang.org/grpc v1.50.1
go: found github.com/uber/jaeger-client-go/config in github.com/uber/jaeger-client-go v2.30.0+incompatible
go: found gopkg.in/mgo.v2 in gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
go: downloading github.com/stretchr/testify v1.7.0
go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
go: downloading github.com/google/go-cmp v0.5.6
go: downloading google.golang.org/protobuf v1.27.1
go: downloading golang.org/x/sys v0.2.0
go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: downloading golang.org/x/text v0.4.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/stretchr/objx v0.1.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/uber/jaeger-lib/metrics
go: finding module for package gopkg.in/yaml.v2
go: finding module for package go.uber.org/atomic
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/pkg/errors
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/uber/jaeger-lib/metrics/metricstest
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/uber/jaeger-lib v2.4.1+incompatible
go: downloading go.uber.org/atomic v1.10.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: found github.com/pkg/errors in github.com/pkg/errors v0.9.1
go: found github.com/uber/jaeger-lib/metrics in github.com/uber/jaeger-lib v2.4.1+incompatible
go: found go.uber.org/atomic in go.uber.org/atomic v1.10.0
go: found github.com/uber/jaeger-lib/metrics/metricstest in github.com/uber/jaeger-lib v2.4.1+incompatible
go: found gopkg.in/yaml.v2 in gopkg.in/yaml.v2 v2.4.0
go: finding module for package github.com/HdrHistogram/hdrhistogram-go
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: downloading github.com/HdrHistogram/hdrhistogram-go v1.1.2
go: found github.com/HdrHistogram/hdrhistogram-go in github.com/HdrHistogram/hdrhistogram-go v1.1.2
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading github.com/kr/text v0.2.0
go: finding module for package github.com/ucy-coast/hotel-app/internal/rate/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/profile/proto
go: finding module for package github.com/ucy-coast/hotel-app/internal/geo/proto
github.com/ucy-coast/hotel-app/internal/frontend imports
github.com/ucy-coast/hotel-app/internal/profile/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/profile/proto: module github.com/ucy-coast/hotel-app/internal/profile/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
github.com/ucy-coast/hotel-app/internal/geo imports
github.com/ucy-coast/hotel-app/internal/geo/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/geo/proto: module github.com/ucy-coast/hotel-app/internal/geo/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
github.com/ucy-coast/hotel-app/internal/rate imports
github.com/ucy-coast/hotel-app/internal/rate/proto: cannot find module providing package github.com/ucy-coast/hotel-app/internal/rate/proto: module github.com/ucy-coast/hotel-app/internal/rate/proto: git ls-remote -q origin in /go/pkg/mod/cache/vcs/25d7ecce62d5217dbfc309e95fa0935ac3442cda3276f618cce8defe7a0cec32: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
ERROR: Service 'profile' failed to build: The command '/bin/sh -c go mod tidy' returned a non-zero code: 1
1条答案
按热度按时间ldxq2e6h1#
不太确定您的设置,您可以尝试此操作。
将这些行添加到
~/.gitconfig
文件中