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

go1.16beta1: Running go application with go run returns a runtime error. #43320

Closed
rbo13 opened this issue Dec 22, 2020 · 6 comments
Closed

go1.16beta1: Running go application with go run returns a runtime error. #43320

rbo13 opened this issue Dec 22, 2020 · 6 comments

Comments

@rbo13
Copy link

rbo13 commented Dec 22, 2020

Hi, feel free to close this issue if this is a duplicate. I have encountered an error running my sample application with an initial go code.

This is my sample go code:

package main

import "fmt"

func main() {
	fmt.Println("Hello, World!")
}

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

$ go version
$ go version go1.16beta1 linux/amd64

Does this issue reproduce with the latest release?

Not sure.

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/bito/Projects/dev/go/bin"
GOCACHE="/home/bito/.cache/go-build"
GOENV="/home/bito/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/bito/Projects/dev/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/bito/Projects/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16beta1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/bito/Projects/dev/go/src/github.com/rbo13/hello-world/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4152057781=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Create a sample application, and run the application using go run command. Here is the link of my sample code.

What did you expect to see?

$ Hello, World

What did you see instead?

$ go run main.go
# runtime
/usr/local/go/src/runtime/mgcsweepbuf.go:87:80: memstats.gc_sys undefined (type mstats has no field or method gc_sys)
/usr/local/go/src/runtime/mgcsweepbuf.go:106:102: memstats.gc_sys undefined (type mstats has no field or method gc_sys)

I did not encounter this issue when I was using go 1.15 version.

@egonelbre
Copy link
Contributor

egonelbre commented Dec 22, 2020

Did you delete previous installation of Go before extracting go1.16beta1? mgcsweepbuf.go does not exist in Go 1.16 codebase.

@bcmills
Copy link
Contributor

bcmills commented Dec 22, 2020

If you are building the Go distribution from source, you may need to run git clean -df prior to make.bash.

@rbo13
Copy link
Author

rbo13 commented Dec 22, 2020

Did you delete previous installation of Go before extracting go1.16beta1? mgcsweepbuf.go does not exist in Go 1.16 codebase.

No, I did not. Do I need to delete the previous installation first?

@egonelbre
Copy link
Contributor

@rbo13 Yes, see the first line in https://golang.org/doc/install#install.

@rbo13
Copy link
Author

rbo13 commented Dec 22, 2020

@rbo13 Yes, see the first line in https://golang.org/doc/install#install.

Oops, my bad. Didn't notice it. Will try it and see if it fixes the issue.

@rbo13
Copy link
Author

rbo13 commented Dec 22, 2020

Now works will close the issue. Sorry for the trouble. Didn't notice to delete the previous installation of go. Thanks for the help @egonelbre 👍

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