-
Notifications
You must be signed in to change notification settings - Fork 158
style: enable gosec linter #1202
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
Open
JonathanOppenheimer
wants to merge
39
commits into
master
Choose a base branch
from
lint-enable-gosec
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+74
−49
Open
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d24bd6a
lint enable gosec
JonathanOppenheimer b465187
make tests deterministic
JonathanOppenheimer 969b51e
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 01395ef
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 3b51256
Update plugin/evm/message/helpers_test.go
JonathanOppenheimer fb0a1c6
first round stephen reviews
JonathanOppenheimer 6021c88
redo rand implementation
JonathanOppenheimer e2dd1c0
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer eab8c81
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer e9e136d
austin suggestion
JonathanOppenheimer 66e1c6f
lol what
JonathanOppenheimer 7cbf4c8
lint
JonathanOppenheimer f92fa5a
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 37f65a0
revert balance
JonathanOppenheimer 57ec43b
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 5fd167c
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer b050e4f
Austin suggestions
JonathanOppenheimer d960769
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer c121ab6
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer eaf433d
Austin suggestions
JonathanOppenheimer 341e908
clean-up
JonathanOppenheimer 7172e4f
update request strings
JonathanOppenheimer 40ebd2b
this too
JonathanOppenheimer 80c06b8
use correct rand
JonathanOppenheimer 603dd3b
crypto rand
JonathanOppenheimer 57989a3
more aggressive corruption
JonathanOppenheimer b244df3
fix seeding here too
JonathanOppenheimer 62ec0ca
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 8e657bf
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer e02b224
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 8d0388a
fix imports
JonathanOppenheimer 62612f3
lint
JonathanOppenheimer 1f1bb2a
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 6786d70
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 791ba8d
austin review
JonathanOppenheimer 7da3ca1
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer 28e116d
lint
JonathanOppenheimer ba427bb
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer bc84850
Merge branch 'master' into lint-enable-gosec
JonathanOppenheimer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ linters: | |
- goconst | ||
- gocritic | ||
- goprintffuncname | ||
# - gosec | ||
- gosec | ||
- govet | ||
- importas | ||
- ineffassign | ||
|
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package message | ||
|
||
import ( | ||
"crypto/sha256" | ||
"fmt" | ||
) | ||
|
||
func deterministicBytes(label string, n int) []byte { | ||
buf := make([]byte, n) | ||
off := 0 | ||
var ctr uint64 | ||
JonathanOppenheimer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
for off < n { | ||
h := sha256.Sum256([]byte(fmt.Sprintf("%s-%d", label, ctr))) | ||
JonathanOppenheimer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
toCopy := n - off | ||
if toCopy > len(h) { | ||
toCopy = len(h) | ||
} | ||
copy(buf[off:], h[:toCopy]) | ||
off += toCopy | ||
JonathanOppenheimer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
ctr++ | ||
} | ||
return buf | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.