Please answer these questions before submitting your issue. Thanks!
go version)?go version go1.10.2 darwin/amd64
Yes
go env)?GOARCH="amd64"
GOBIN="/Users/sigurd/go/bin"
GOCACHE="/Users/sigurd/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sigurd/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b7/lntxvqq15dvgfmlhptx_8y_m0000gp/T/go-build399896100=/tmp/go-build -gno-record-gcc-switches -fno-common"
vgo get golang.org/x/image
vgo: finding golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: downloading golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: extracting golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: import "golang.org/x/image" [/Users/sigurd/go/src/v/golang.org/x/[email protected]]: no Go source files
golang.org/x/image isn't a package, even go get golang.org/x/image errors
What @AlexRouSg said. Closing here, since it doesn't look like a bug.
Fair enough. I followed instructions in https://github.com/golang/image/blob/master/README.md, which then need updating.
Change https://golang.org/cl/115675 mentions this issue: README: fix go get instructions
Thanks for pointing that out @shogsbro - I've filed https://go-review.googlesource.com/#/c/image/+/115675 to address the README problem.
Further info:
$ mkdir vgotest
$ cd vgotest/
$ touch go.mod
$ vi vgotest.go
$ vgo get golang.org/x/image/tiff
vgo get golang.org/x/image/tiff: module root is "golang.org/x/image"
$ vgo get golang.org/x/image
vgo: finding golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: downloading golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: import "golang.org/x/image" [~/go/src/v/golang.org/x/[email protected]]: no Go source files
I can work around this by importing from the Github mirror, but points to adoption issues with vgo
@shogsbro vgo get is used to fetch Go modules (hence the first error); so there isn't the symmetry with go get you might expect. This is also being discussed in https://github.com/golang/go/issues/24105
Instead you can simply rely on vgo build etc:
cd `mktemp -d`
export GOPATH=$PWD
mkdir hello
cd hello
cat <<EOD > hello.go
package main // import "example.com/hello"
import _ "golang.org/x/image/tiff"
func main() {
}
EOD
echo > go.mod
vgo build
cat go.mod
Gives:
module example.com/hello
require golang.org/x/image v0.0.0-20180403161127-f315e4403028
Eureka, this worked! However, this at least to me is a non-obvious way of doing it.
@myitcv There's a more specific issue on having no go files on the root dir. #24008
@shogsbro That's the normal vgo workflow actually, so once vgo is stable I expect there to be more docs and instructions on how to do things. Right now you'll have to depend on https://research.swtch.com/vgo and asking around.
@shogsbro undoubtedly there's more documentation required for vgo (it will follow), particularly in areas where concepts change from the old go ways: ideally in this situation I would have pointed you towards a guide/README that covered the salient points. But glad you're up and running.
@AlexRouSg - sorry, our messages overlapped there.
Yes, there are a number of open issues around vgo get. I linked to that particular issue because Russ appeared to reference that as the umbrella issue. But either way, we know what you're talking about :)
Thanks to you both for your quick responses & solutions.
To clarify, I am using vgo in an air-gapped environment, and have a dummy project outside this environment to populate ~/go/src/v/... using vgo get, which then is imported thru a scanning process. Any pointers on a canonical way to improve this process-flow gratefully received.
@shogsbro I suggest you to post in one of the places listed in https://github.com/golang/go/wiki/Questions if you need more help on vgo. As not only is this a closed issue, the bug tracker is not normally used for discussions.
As not only is this a closed issue, the bug tracker is not normally used for discussions.
The Slack channel #vgo is a good place to ask questions indeed.
But in the absence of good documentation, a stable version of vgo etc, I suspect Russ' original instruction to post issues here (https://research.swtch.com/vgo-tour) remains. Because questions might in fact be issues at this stage.
Most helpful comment
The Slack channel
#vgois a good place to ask questions indeed.But in the absence of good documentation, a stable version of vgo etc, I suspect Russ' original instruction to post issues here (https://research.swtch.com/vgo-tour) remains. Because questions might in fact be issues at this stage.