golang/go

cmd/cover: use different //line comment for code that does not come from source file

Ouverte

#25 280 ouverte le 7 mai 2018

 (10 commentaires) (0 réaction) (0 personne assignée)Go (19 008 forks)batch import
NeedsFixcompiler/runtimehelp wanted

Métriques du dépôt

Stars
 (133 883 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur