mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Lint: Fix broken / missing nosec / nolint comments
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7fa2c2e4b6
commit
e259ca209c
3 changed files with 5 additions and 5 deletions
|
@ -22,7 +22,7 @@ func randomString(lst ...string) (string, error) {
|
|||
return "", errors.New("empty list given")
|
||||
}
|
||||
|
||||
return lst[rand.Intn(len(lst))], nil
|
||||
return lst[rand.Intn(len(lst))], nil // #nosec:G404 // This is used to select a random string from a list, no crypto-use
|
||||
}
|
||||
|
||||
func stableRandomFromSeed(seed string) (float64, error) {
|
||||
|
@ -31,11 +31,11 @@ func stableRandomFromSeed(seed string) (float64, error) {
|
|||
return 0, errors.Wrap(err, "generating seed")
|
||||
}
|
||||
|
||||
return rand.New(rand.NewSource(seedValue)).Float64(), nil // #nosec G404 // Only used for generating a random number from static string, no need for cryptographic safety
|
||||
return rand.New(rand.NewSource(seedValue)).Float64(), nil // #nosec:G404 // Only used for generating a random number from static string, no need for cryptographic safety
|
||||
}
|
||||
|
||||
func stringToSeed(s string) (int64, error) {
|
||||
hash := md5.New() // #nosec G401 // Unly used to convert a string into a numer, no need for cryptographic safety
|
||||
hash := md5.New() // #nosec:G401 // Unly used to convert a string into a numer, no need for cryptographic safety
|
||||
if _, err := fmt.Fprint(hash, s); err != nil {
|
||||
return 0, errors.Wrap(err, "writing string to hasher")
|
||||
}
|
||||
|
|
2
main.go
2
main.go
|
@ -151,7 +151,7 @@ func handleSubCommand(args []string) {
|
|||
}
|
||||
}
|
||||
|
||||
//nolint: funlen,gocognit,gocyclo // Complexity is a little too high but makes no sense to split
|
||||
//nolint:funlen,gocognit,gocyclo // Complexity is a little too high but makes no sense to split
|
||||
func main() {
|
||||
var err error
|
||||
|
||||
|
|
|
@ -739,7 +739,7 @@ func (c *Client) getTwitchAppAccessToken() (string, error) {
|
|||
return rData.AccessToken, nil
|
||||
}
|
||||
|
||||
//nolint: gocognit,gocyclo // Not gonna split to keep as a logical unit
|
||||
//nolint:gocognit,gocyclo // Not gonna split to keep as a logical unit
|
||||
func (c *Client) request(opts clientRequestOpts) error {
|
||||
log.WithFields(log.Fields{
|
||||
"method": opts.Method,
|
||||
|
|
Loading…
Reference in a new issue