cmd/cover: use different //line comment for code that does not come from source file
#25,280 opened on May 7, 2018
Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
What version of Go are you using (go version)?
go version go1.10.1 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOARCH="amd64" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GORACE="" GOTMPDIR="" GCCGO="gccgo" CC="clang" CXX="clang++" 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" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m6/vs051rl54k3_sgxr94ylcz5h0000gn/T/go-build238749509=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
git clone git@github.com:linzhp/go_examples.git
cd go_examples/hyphen
go tool cover -mode set -var Var_power-driven -o power-driven-gen.go power-driven.go
go run main.go
What did you expect to see?
An error pointing to the right line of power-driven-gen.go
What did you see instead?
power-driven.go:7:14: expected ';', found '-'
However, power-driven.go has less than 7 lines.