Skip to content
Open
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
7 changes: 7 additions & 0 deletions ruleguard.rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,10 @@ func ioStringWriterWriteStringMisuse(m dsl.Matcher) {
Report(`Use Write when writing a []byte to an io.Writer`).
Suggest(`$w.Write($b)`)
}

func randSeed(m dsl.Matcher) {
m.Match(
`rand.Seed($s)`,
).Report(`As of Go 1.20, the math.Seed func is deprecated as programs should not use the global default source.`).
Suggest(`rand.New(rand.NewSource($s))`)
}