-
Notifications
You must be signed in to change notification settings - Fork 38
/
marshaljson.yml
31 lines (29 loc) · 1.01 KB
/
marshaljson.yml
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
rules:
- id: marshal-json-pointer-receiver
patterns:
- pattern-either:
- pattern: func ($T *$TYPE) MarshalJSON() ($DATA []byte, $ERR error)
- pattern: func ($T *$TYPE) MarshalJSON() ([]byte, error)
message: "MarshalJSON with a pointer receiver has surprising results: https://github.com/golang/go/issues/22967"
languages: [go]
severity: ERROR
- id: marshal-json-misspell
pattern-either:
- patterns:
- pattern-regex: (?i)func \((.+)\) marshal[l]?json\((.*)\)
- pattern-not-regex: func \(.+\) MarshalJSON\(
fix: func ($1) MarshalJSON($2)
message: |
Misspelling of MarshalJSON.
languages: [go]
severity: ERROR
- id: unmarshal-json-misspell
pattern-either:
- patterns:
- pattern-regex: (?i)func \((.+)\) unmarshal[l]?json\((.*)\)
- pattern-not-regex: func \(.+\) UnmarshalJSON\(
fix: func ($1) UnmarshalJSON($2)
message: |
Misspelling of UnmarshalJSON.
languages: [go]
severity: ERROR