Skip to content

Harmonising capitalisation of "token" in error strings #97

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

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c RegisteredClaims) Valid() error {
}

if !c.VerifyIssuedAt(now, false) {
vErr.Inner = fmt.Errorf("Token used before issued")
vErr.Inner = fmt.Errorf("token used before issued")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why this PR? Are you relying on the capitilization?

I'm indifferent about this one way or the other, but I'd prefer to avoid these kinds of PRs. Closing.

Also. https://github.com/golang/go/wiki/CodeReviewComments#error-strings

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't he try to remove the capitalisation? It seems that we missed this one, the other Errorf calls are also lowercased.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, diff'd it wrong. You're right, apologies @yoogoc . Thanks for your contribution. My mistake.

vErr.Errors |= ValidationErrorIssuedAt
}

Expand Down Expand Up @@ -148,7 +148,7 @@ func (c StandardClaims) Valid() error {
}

if !c.VerifyIssuedAt(now, false) {
vErr.Inner = fmt.Errorf("Token used before issued")
vErr.Inner = fmt.Errorf("token used before issued")
vErr.Errors |= ValidationErrorIssuedAt
}

Expand Down