Skip to content
New issue

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

crypto/x509: apply gofmt to verify.go #35052

Closed
graywolf opened this issue Oct 21, 2019 · 6 comments
Closed

crypto/x509: apply gofmt to verify.go #35052

graywolf opened this issue Oct 21, 2019 · 6 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.

Comments

@graywolf
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
+$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wolf/.cache/go-build"
GOENV="/home/wolf/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/wolf/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/wolf/devel/go/src/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-build608751303=/tmp/go-build -gno-record-gcc-switches"

What did you do?

+$ go fmt ./...
crypto/x509/verify.go

What did you expect to see?

+$ go fmt ./...
+$ git diff

What did you see instead?

+$ go fmt ./...
crypto/x509/verify.go
+$ git diff
diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go
index c8bad642f0..358fca4705 100644
--- a/src/crypto/x509/verify.go
+++ b/src/crypto/x509/verify.go
@@ -578,13 +578,13 @@ func (c *Certificate) isValid(certType int, currentChain []*Certificate, opts *V
        }
        if now.Before(c.NotBefore) {
                return CertificateInvalidError{
-                       Cert: c,
+                       Cert:   c,
                        Reason: Expired,
                        Detail: fmt.Sprintf("current time %s is before %s", now.Format(time.RFC3339), c.NotBefore.Format(time.RFC3339)),
                }
        } else if now.After(c.NotAfter) {
                return CertificateInvalidError{
-                       Cert: c,
+                       Cert:   c,
                        Reason: Expired,
                        Detail: fmt.Sprintf("current time %s is after %s", now.Format(time.RFC3339), c.NotAfter.Format(time.RFC3339)),
                }
@slrz
Copy link

slrz commented Oct 21, 2019

Probably the result of some earlier fine-tuning of the fmt algorithms. They are not guaranteed to give the exact same output accross Go releases, although any adjustments tend to be minor in character.

It will get fixed up the next time someone touches that file in the course of doing some actual work. Until that happens, the current state doesn't hurt anyone, I guess?

@graywolf
Copy link
Author

Yeah I was just surprised go fmt on clean clone actually changed something so I've decided to make a ticket. I mean, it should be like 1 minute for someone with commit rights to fix.

@agnivade
Copy link
Contributor

You are most welcome to send a patch.

@agnivade agnivade changed the title crypto/x509/verify.go is not properly formated according to go fmt crypto/x509: apply gofmt to verify.go Oct 22, 2019
@agnivade agnivade added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Oct 22, 2019
@graywolf
Copy link
Author

Seems to require having google account and signing CLA, so I leave it up to someone willing to put up with both.

@evalevanto
Copy link

I can easily claim this and send a patch.

@gopherbot
Copy link

Change https://golang.org/cl/202877 mentions this issue: Github Issue: crypto/x509: apply gofmt to verify.go #35052

@golang golang locked and limited conversation to collaborators Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants