You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
What did you see instead?
System details
go version go1.11.1 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fpf/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/data/app/go"
GOPROXY=""
GORACE=""
GOROOT="/data/app/go/src/go1.11.1"
GOTMPDIR=""
GOTOOLDIR="/data/app/go/src/go1.11.1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.11.1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.11.1
uname -v: Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64
ProductName: Mac OS X
ProductVersion: 10.13.5
BuildVersion: 17F77
lldb --version: lldb-902.0.79.7
Swift-4.1
gdb --version: GNU gdb (GDB) 8.1.1
When i create new file named test.go in the src/cmd/compile, then i execute go run main.go test.go, i got err :
./test.go:3:6: main redeclared in this block
previous declaration at ./main.go:40:6
The text was updated successfully, but these errors were encountered:
You have two defined the function main in two different places. That is what the error message is telling you. This is not a bug.
If you have questions about how to use Go I encourage you to use a forum rather than the bug tracker. Please see https://golang.org/wiki/Questions. Thanks.
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
What did you see instead?
System details
When i create new file named test.go in the src/cmd/compile, then i execute go run main.go test.go, i got err :
./test.go:3:6: main redeclared in this block
previous declaration at ./main.go:40:6
The text was updated successfully, but these errors were encountered: