go version)?go version go1.11 linux/amd64
Yes
go env)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/btburke/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/btburke/projects/golang"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/btburke/projects/go-git/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-build221368368=/tmp/go-build -gno-record-gcc-switches"
git clone https://github.com/src-d/go-git
go mod init
go build
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I expected it to correctly find all dependencies and create go.mod and go.sum
go: finding golang.org/x/text/unicode/norm latest
go: finding golang.org/x/text/unicode latest
utils/merkletrie/noder/path.go:7:2: unknown import path "golang.org/x/text/unicode/norm": cannot find module providing package golang.org/x/text/unicode/norm
I could not reproduce this. Build worked just fine.
IIRC, I have seen errors like that before, and usually it went away with a retry. Could you try cleaning your modcache and build again ?
Weird. I cleared my cache and it builds on one computer and not the other. Must be me. Sorry for the hassle.
I am seeing this same issue on my windows machine
go version go1.11.2 windows/amd64
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\erik\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\erik\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\erik\Projects\example\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\erik\AppData\Local\Temp\go-build577259682=/tmp/go-build -gno-record-gcc-switches
PS C:\Users\erik\Projects\example> go build .\...
go: finding golang.org/x/text/unicode/norm latest
go: finding golang.org/x/text/secure/bidirule latest
go: finding golang.org/x/text/unicode/bidi latest
go: finding golang.org/x/text/secure latest
go: finding golang.org/x/text/unicode latest
..\..\go\pkg\mod\golang.org\x\[email protected]\idna\idna.go:23:2: unknown import path "golang.org/x/text/secure/bidirule": cannot find module providing package golang.org/x/text/secure/bidirule
..\..\go\pkg\mod\golang.org\x\[email protected]\idna\idna.go:24:2: unknown import path "golang.org/x/text/unicode/bidi": cannot find module providing package golang.org/x/text/unicode/bidi
..\..\go\pkg\mod\golang.org\x\[email protected]\idna\idna.go:25:2: unknown import path "golang.org/x/text/unicode/norm": cannot find module providing package golang.org/x/text/unicode/norm
go clean -modcache did the trick for me @brkattk...
yes, clearing the cache worked. forgot to post back. thanks!
Most helpful comment
go clean -modcachedid the trick for me @brkattk...