-
Notifications
You must be signed in to change notification settings - Fork 2
/
checkers_os.go
36 lines (32 loc) · 812 Bytes
/
checkers_os.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mirror
import "github.com/butuzov/mirror/internal/checker"
var OsFileMethods = []checker.Violation{
{ // (*os.File).Write
Targets: checker.Bytes,
Type: checker.Method,
Package: "os",
Struct: "File",
Caller: "Write",
Args: []int{0},
AltCaller: "WriteString",
Generate: &checker.Generate{
PreCondition: `f := &os.File{}`,
Pattern: `Write($0)`,
Returns: []string{"int", "error"},
},
},
{ // (*os.File).WriteString
Targets: checker.Strings,
Type: checker.Method,
Package: "os",
Struct: "File",
Caller: "WriteString",
Args: []int{0},
AltCaller: "Write",
Generate: &checker.Generate{
PreCondition: `f := &os.File{}`,
Pattern: `WriteString($0)`,
Returns: []string{"int", "error"},
},
},
}