Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.12 linux/amd64
Does this issue reproduce with the latest release?
I have the latest 1.12
What operating system and processor architecture are you using (go env
)?
Linux Mint 19.1
go env
Output
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/home/toshiba/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/toshiba/Documents/workspace/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="0" GOMOD="/home/toshiba/Documents/workspace/go_projects/active-sport-server/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build887106064=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Tried to run GO111MODULE=on CGO_ENABLED=0 go build
outside of $GOPATH
in order to try go modules. But there seems some problem with net/http
package.
$ cat main.go package main import "net/http" func main() { http.ListenAndServe(":8080", nil) }
What did you expect to see?
correctly built
What did you see instead?
$ GO111MODULE=on CGO_ENABLED=0 go build # crypto/rc4 /usr/local/go/src/crypto/rc4/rc4_asm.go:15:18: (*Cipher).XORKeyStream redeclared in this block previous declaration at /usr/local/go/src/crypto/rc4/rc4.go:61:6 # bytes /usr/local/go/src/bytes/bytes_decl.go:10:6: IndexByte redeclared in this block previous declaration at /usr/local/go/src/bytes/bytes.go:101:34 /usr/local/go/src/bytes/bytes_decl.go:17:6: Equal redeclared in this block previous declaration at /usr/local/go/src/bytes/bytes.go:18:25 /usr/local/go/src/bytes/bytes_decl.go:24:6: Compare redeclared in this block previous declaration at /usr/local/go/src/bytes/bytes.go:37:27 # crypto/cipher /usr/local/go/src/crypto/cipher/xor_amd64.go:9:6: xorBytes redeclared in this block previous declaration at /usr/local/go/src/crypto/cipher/xor.go:58:33 /usr/local/go/src/crypto/cipher/xor_amd64.go:22:6: xorWords redeclared in this block previous declaration at /usr/local/go/src/crypto/cipher/xor.go:83:27 # strings /usr/local/go/src/strings/strings_decl.go:8:6: IndexByte redeclared in this block previous declaration at /usr/local/go/src/strings/strings.go:150:34
Activity
[-]Issue with net/http with go modules on linux[/-][+]cmd/go: Issue with net/http with go modules on linux[/+]mikioh commentedon Mar 19, 2019
Fortunately, tip works well with "GO111MODULE=on CGO_ENABLED=0 go build" at $GOROOT/src/net/http.
acln0 commentedon Mar 19, 2019
I think you have somehow overwritten your previous Go installation with a new one. The assembly implementation of
rc4
was removed in1.12
, but you seem to have both.I suggest wiping the current installation, and reinstalling Go, preferably using the official tarball rather than your OS package manager.
agnivade commentedon Mar 19, 2019
Yes, your installation seems broken. This is not a modules issue. Just try with
go build
and even that should fail. Please delete your previous installation and do a clean install.If that does not solve your issue, feel free to reopen. Thanks.
talgat-ruby commentedon Mar 19, 2019
Thanks the deleting previous installation and reinstalling helped.