2017-03-19 1 views
-1

go 패키지를 설치하려고합니다. 나는 패키지를 복제를 구축하기 위해 다음 명령을 실행 :.go 패키지를 빌드 할 때 치명적인 오류가 발생했습니다.

$go get -v -d 

Fetching https://golang.org/x/net/publicsuffix?go-get=1 
Parsing meta tags from https://golang.org/x/net/publicsuffix?go-get=1 (status code 200) 
get "golang.org/x/net/publicsuffix": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/publicsuffix?go-get=1 
get "golang.org/x/net/publicsuffix": verifying non-authoritative meta tag 
Fetching https://golang.org/x/net?go-get=1 
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200) 
golang.org/x/net (download) 

$go build *.go 
# github.com/moul/http2curl 
gccgo: error: $HOME/go/src/github.com/moul/http2curl/http2curl.go: No such file or directory 
gccgo: fatal error: no input files 
compilation terminated. 
# github.com/pkg/errors 
gccgo: error: $HOME/go/src/github.com/pkg/errors/errors.go: No such file or directory 
gccgo: error: $HOME/go/src/github.com/pkg/errors/stack.go: No such file or directory 
gccgo: fatal error: no input files 
compilation terminated. 
# golang.org/x/net/publicsuffix 
gccgo: error: $HOME/go/src/golang.org/x/net/publicsuffix/list.go: No such file or directory 
gccgo: error: $HOME/go/src/golang.org/x/net/publicsuffix/table.go: No such file or directory 
gccgo: fatal error: no input files 
compilation terminated. 

나는 $ 홈에 github.com/moul/http2curl 복제 시도/이동/SRC/github.com/moul/http2curl와 http2curl.go 파일이 정확히 지정된 경로에 있지만 아직 해당 파일 또는 디렉토리 없음이라고 표시됩니다. 어떻게 만들 수 있습니까?

+2

개별 파일을 지정하지 않고 이름으로 패키지를 빌드합니다. – JimB

답변

0

평범한 무엇이 go get -v -d을 얻을 수 있는지 모르겠지만 설치하려는 패키지를 지정해야합니다.

$go get github.com/moul/http2curl

-d 플래그가 없으면이 당신을 위해 패키지 http2curl를 다운로드하고 설치해야합니다 은 그래서 당신이해야하는 것은이 같은 것입니다. 그러나 -d 플래그를 사용하는 경우 먼저 패키지의 디렉토리로 이동하여 패키지를 설치할 수 있습니다. (.go *없이)

$cd $GOPATH/src/github.com/moul/http2curl

그리고 실행 빌드.

$go build

관련 문제