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

x/vgo: undefined: main.Main on go get #28521

Closed
akshaybabloo opened this issue Nov 1, 2018 · 6 comments

Comments

@akshaybabloo
Copy link

commented Nov 1, 2018

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

go version go1.11.1 windows/amd64

Does this issue reproduce with the latest release?

Yes.

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

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\aksha\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\aksha\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\aksha\Documents\GitHub\hugo\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\aksha\AppData\Local\Temp\go-build630578646=/tmp/go-build -gno-record-gcc-switches

What did you do?

I tried doing go get -u golang.org/x/vgo.

What did you expect to see?

Should download and build vgo.

What did you see instead?

I get this error:

go: finding golang.org/x/vgo latest
go: downloading golang.org/x/vgo v0.0.0-20180912184537-9d567625acf4
# golang.org/x/vgo
..\..\..\go\pkg\mod\golang.org\x\vgo@v0.0.0-20180912184537-9d567625acf4\main.go:31:2: undefined: main.Main

Not sure what it is.

@gopherbot gopherbot added this to the vgo milestone Nov 1, 2018

@agnivade

This comment has been minimized.

Copy link
Member

commented Nov 1, 2018

Hi @akshaybabloo - modules support is now integrated into the main Go toolchain. So you do not need to install vgo separately since I see that you already have 1.11.

This is happening because you have GO111MODULE=on, you can either use the Go modules support natively in 1.11, or use go get with GO111MODULE=off|auto.

@akshaybabloo

This comment has been minimized.

Copy link
Author

commented Nov 1, 2018

@agnivade Then vgo should be there by default, isn't it? Because when I type in vgo I get unknown command error.

@akshaybabloo

This comment has been minimized.

Copy link
Author

commented Nov 1, 2018

Nevermind. thanks for your help. @agnivade

@agnivade

This comment has been minimized.

Copy link
Member

commented Nov 1, 2018

There is no vgo. Modules are supported natively by Go. See this for further info - https://github.com/golang/go/wiki/Modules.

Thank you.

@akshaybabloo

This comment has been minimized.

Copy link
Author

commented Nov 1, 2018

@agnivade True, my bad.

@boogie4eva

This comment has been minimized.

Copy link

commented Mar 27, 2019

So that means no more vgo just go build right ?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.