Add fmt, vet, staticcheck to CI and lint accordingly#89
Merged
peterbourgon merged 7 commits intooklog:mainfrom Nov 8, 2022
craigpastro:typos
Merged
Add fmt, vet, staticcheck to CI and lint accordingly#89peterbourgon merged 7 commits intooklog:mainfrom craigpastro:typos
peterbourgon merged 7 commits intooklog:mainfrom
craigpastro:typos
Conversation
Member
|
Sure! Thanks. The file is extremely organically grown :) |
added 2 commits
October 24, 2022 08:04
Contributor
Author
|
No worries! I added a lint step to the ci. If you don't like/need that I can revert the commit. |
.github/workflows/test.yml
Outdated
Comment on lines
+11
to
+12
| with: | ||
| go-version-file: "./go.mod" |
Member
There was a problem hiding this comment.
I don't think this is necessary?
Contributor
Author
There was a problem hiding this comment.
Probably not. I'll remove it. Thanks!
.github/workflows/test.yml
Outdated
Comment on lines
+13
to
+16
| - name: Lint | ||
| uses: golangci/golangci-lint-action@v3 | ||
| with: | ||
| version: latest |
Member
There was a problem hiding this comment.
Not a fan of this one, let's do go fmt, go vet, and staticcheck.
Contributor
Author
There was a problem hiding this comment.
Okay. Done. Thanks!
ulid_test.go
Outdated
Comment on lines
+607
to
+609
| u0 := ulid.MustNew(t0, safe) | ||
| u1 := ulid.MustNew(t0, safe) | ||
| for j := 0; j < 1024; j++ { | ||
| u0, u1 = u1, ulid.MustNew(t0, safe) | ||
| u0, u1 := u1, ulid.MustNew(t0, safe) |
Contributor
Author
There was a problem hiding this comment.
golangci-lint didn't like that. Reverted. Thanks!
Contributor
Author
There was a problem hiding this comment.
Oops. staticcheck also doesn’t like it.
Member
|
OK, so maybe u0 := ulid.MustNew(t0, safe)
u1 := u0
for j := 0; j < 1024; j++ {
u0, u1 = u1, ulid.MustNew(t0, safe)
...? |
Member
|
Or if that doesn't work var (
u0 = ulid.MustNew(t0, safe)
u1 ulid.ULID
)
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix some small typos in the comments.
By the way, it also seems that
ulid.gois not properly gofmted. For example, when I run it I get a bunch of stuff that looks likein the diff. Would you like me to push those changes in this PR?