Skip to content

Conversation

@lmt-swallow
Copy link
Member

This PR adds some insecure codes to main.go. These changes will result in alerts by reviewdog and gosec.


func main() {
fmt.Printf("Hello!")
r := rand.Int()

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
G404: Use of weak random number generator (math/rand instead of crypto/rand) (gosec)

input.Scan()

path := filepath.Join("/test", input.Text())
f, err := ioutil.ReadFile(path)

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
G304: Potential file inclusion via variable (gosec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants