Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go get dependency fail for go 1.6, but not 1.5 #18277

Closed
vodolaz095 opened this issue Dec 10, 2016 · 7 comments
Closed

Go get dependency fail for go 1.6, but not 1.5 #18277

vodolaz095 opened this issue Dec 10, 2016 · 7 comments

Comments

@vodolaz095
Copy link

vodolaz095 commented Dec 10, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

[vodolaz095@ivory ~]$ go version
go version go1.6.3 linux/amd64

Version being installed by dnf install golang

What operating system and processor architecture are you using (go env)?

[vodolaz095@ivory ~]$ cat /etc/fedora-release 
Fedora release 24 (Twenty Four)
[vodolaz095@ivory ~]$ uname -a
Linux ivory 4.8.11-200.fc24.x86_64 #1 SMP Mon Nov 28 19:36:57 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[vodolaz095@ivory ~]$ go version
go version go1.6.3 linux/amd64
[vodolaz095@ivory ~]$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vodolaz095/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

I want to run integration tests for my logger module by go test.
This is source code of this module: https://github.com/vodolaz095/vdlog

It doesn't works for Go version 1.6.
Full output:

[vodolaz095@ivory ~]$ cat /etc/fedora-release 
Fedora release 24 (Twenty Four)
[vodolaz095@ivory ~]$ uname -a
Linux ivory 4.8.11-200.fc24.x86_64 #1 SMP Mon Nov 28 19:36:57 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[vodolaz095@ivory ~]$ go version
go version go1.6.3 linux/amd64
[vodolaz095@ivory ~]$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vodolaz095/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
[vodolaz095@ivory ~]$ go get github.com/vodolaz095/vdlog
[vodolaz095@ivory ~]$ cd $GOPATH/src/github.com/vodolaz095/vdlog
[vodolaz095@ivory vdlog]$ pwd
/home/vodolaz095/go/src/github.com/vodolaz095/vdlog
[vodolaz095@ivory vdlog]$ ls -l $GOPATH/src/github.com/fatih/color
total 32
-rw-rw-r--. 1 vodolaz095 vodolaz095 11802 Dec  8 23:21 color.go
-rw-rw-r--. 1 vodolaz095 vodolaz095  6542 Oct  4 00:46 color_test.go
-rw-rw-r--. 1 vodolaz095 vodolaz095  3738 Sep 26 17:30 doc.go
-rw-rw-r--. 1 vodolaz095 vodolaz095  1079 Sep 26 17:30 LICENSE.md
-rw-rw-r--. 1 vodolaz095 vodolaz095  4062 Oct  4 00:46 README.md
[vodolaz095@ivory vdlog]$ go test
# github.com/vodolaz095/vdlog
./console.go:7: can't find import: "github.com/fatih/color"
FAIL	github.com/vodolaz095/vdlog [build failed]

Travis shows the same - https://travis-ci.org/vodolaz095/vdlog/jobs/182862434

What did you expect to see?

This is the build process for Golang 1.5 on other PC

[vodolaz095@steel ~]$ cat /etc/fedora-release 
Fedora release 23 (Twenty Three)
[vodolaz095@steel ~]$ uname -a
Linux steel.local 4.7.5-100.fc23.x86_64 #1 SMP Mon Sep 26 19:29:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[vodolaz095@steel ~]$ go version
go version go1.5.4 linux/amd64
[vodolaz095@steel ~]$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vodolaz095/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT=""
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
[vodolaz095@steel ~]$ go get github.com/vodolaz095/vdlog
[vodolaz095@steel ~]$ cd $GOPATH/src/github.com/vodolaz095/vdlog
[vodolaz095@steel ~]$ pwd
/home/vodolaz095/go/src/github.com/vodolaz095/vdlog
[vodolaz095@steel vdlog]$  ls -l $GOPATH/src/github.com/fatih/color
total 32
-rw-r--r--. 1 vodolaz095 oldcityk   11802 Dec  9 01:11 color.go
-rw-r--r--. 1 vodolaz095 vodolaz095  6542 Oct  4 07:28 color_test.go
-rw-r--r--. 1 vodolaz095 vodolaz095  3738 Oct  4 07:28 doc.go
-rw-r--r--. 1 vodolaz095 vodolaz095  1079 Oct  4 07:28 LICENSE.md
-rw-r--r--. 1 vodolaz095 vodolaz095  4062 Oct  4 07:28 README.md

[vodolaz095@steel vdlog]$ go test
...
PASS
ok  	github.com/vodolaz095/vdlog	5.409s

Travis report - https://travis-ci.org/vodolaz095/vdlog/jobs/182862433

What did you see instead?

[vodolaz095@ivory vdlog]$ go test
# github.com/vodolaz095/vdlog
./console.go:7: can't find import: "github.com/fatih/color"
FAIL	github.com/vodolaz095/vdlog [build failed]

SUMMARY

On golang 1.6 i cannot go get github.com/fatih/color and that import github.com/fatih/color in source code.
On golang 1.5 i can do it.
Other system settings (like go env) are the same

@bradfitz
Copy link
Contributor

This seems like something wrong with your install or environment. In any case, only Go 1.7 and Go 1.8 are supported by the Go team in the bug tracker.

For questions about Go, see https://golang.org/wiki/Questions.

@vodolaz095
Copy link
Author

ok, i'll made travis integration for Go of 1.7 and 1.8 versions

@vodolaz095
Copy link
Author

for 1.7 - https://travis-ci.org/vodolaz095/vdlog/jobs/182869988

The same

# github.com/vodolaz095/vdlog

./console.go:7: can't find import: "github.com/fatih/color"

FAIL	github.com/vodolaz095/vdlog [build failed]

@vodolaz095
Copy link
Author

i do not think travis has bad environment...

@vodolaz095
Copy link
Author

@bradfitz - please, reopen this issue. i do not think my environment is bad. Mainly because i get THE SAME result as travis.ci

@kardianos
Copy link
Contributor

@vodolaz095 What might help is if you try to run go get again, (run it 2 or 3 times), does it then behave as expected?

@bradfitz
Copy link
Contributor

This is not a Q&A forum for how to use Go.

For questions about Go, see https://golang.org/wiki/Questions.

But the answer is almost certainly that you're missing the -t flag to "go get". See https://golang.org/cmd/go/

The -t flag instructs get to also download the packages required to build the tests for the specified packages.

@golang golang locked and limited conversation to collaborators Dec 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants