mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +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`)
|
||
|
|
}
|