Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go1.12.5 darwin/amd64
Yes, the inconsistency lives on the master branch
go env
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/fenos/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/fenos/Documents/code/go" GOPROXY="" GORACE="" GOROOT="/usr/local/Cellar/go/1.12.5/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" 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/hd/7fyxcyhn01x2pmdqrs892v4h0000gp/T/go-build120066066=/tmp/go-build -gno-record-gcc-switches -fno-common"
Going trough the source code and i've noticed small inconsistencies in the code around the error formatting.
%s
using %v instead of %s https://github.com/golang/go/blob/master/src/crypto/tls/generate_cert.go#L153
%v
not using the interpolation correctly using the %s https://github.com/golang/go/blob/master/src/crypto/tls/generate_cert.go#L148
The text was updated successfully, but these errors were encountered:
I intend to work on a fix for this
Sorry, something went wrong.
Thanks for the report. It's fine to use %v to print a value of type error. If anything %v is more common than %s.
error
The log.Fatalf line should probably just be log.Fatal.
log.Fatalf
log.Fatal
Change https://golang.org/cl/200679 mentions this issue: crypto/tls: Fixes #34848
crypto/tls: Fixes #34848
@iamoryanmoshe yes absolutely, i'm just trying to make things consistent across the file. Would you be happy to change all the %s to %v?
On the second bit, I think it would still be good to have the error printed out within the message
2ac8f79
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, the inconsistency lives on the master branch
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Going trough the source code and i've noticed small inconsistencies in the code around the error formatting.
What did you expect to see?
%s
for interpolating errorsWhat did you see instead?
using
%v
instead of%s
https://github.com/golang/go/blob/master/src/crypto/tls/generate_cert.go#L153not using the interpolation correctly using the
%s
https://github.com/golang/go/blob/master/src/crypto/tls/generate_cert.go#L148The text was updated successfully, but these errors were encountered: