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
Put several Go source code files in this directory, all with build constraints.
From the parent directory of "example", run "go fmt ./example".
What did you expect to see?
No output, and all files in ./example correctly go fmt'ed.
What did you see instead?
The following error:
can't load package: package ./example: build constraints exclude all Go files in /home/matt/example
Additional information
Placing an extra .go file containing nothing but a package clause in the directory makes go fmt behave properly, i.e. it formats everything in the directory and produces no output.
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
go fmt fails if every file in a dir has build constraints
cmd/go: fmt fails if every file in a dir has build constraints
Oct 9, 2017
mvdan
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Oct 9, 2017
What version of Go are you using (
go version
)?go version go1.9.1 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/matt/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build810685112=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
What did you expect to see?
No output, and all files in ./example correctly go fmt'ed.
What did you see instead?
The following error:
can't load package: package ./example: build constraints exclude all Go files in /home/matt/example
Additional information
Placing an extra .go file containing nothing but a package clause in the directory makes go fmt behave properly, i.e. it formats everything in the directory and produces no output.
The text was updated successfully, but these errors were encountered: