mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
24 lines
468 B
Go
24 lines
468 B
Go
//go:build ignore
|
|
// +build ignore
|
|
|
|
package gorules
|
|
|
|
import (
|
|
"github.com/quasilyte/go-ruleguard/dsl"
|
|
)
|
|
|
|
func fmtErrorfWithoutArgs(m dsl.Matcher) {
|
|
m.Match(`fmt.Errorf($msg)`).
|
|
Report(`fmt.Errorf: change for errors.New($msg)`).
|
|
Suggest(`errors.New($msg)`)
|
|
}
|
|
|
|
func createHttpClient(m dsl.Matcher) {
|
|
m.Match(
|
|
`http.Client{$*_}`,
|
|
`new(http.Client)`,
|
|
`http.Transport{$*_}`,
|
|
`new(http.Transport)`,
|
|
).Report(`http.Client: use fleethttp.NewClient instead`)
|
|
}
|