generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 78
/
info.go
27 lines (24 loc) · 1.4 KB
/
info.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
package error
type Info struct {
Name string `yaml:"name" json:"name"`
OldCode string `yaml:"old_code" json:"old_code"`
Code string `yaml:"code" json:"code"`
CodeIsLiteral bool `yaml:"code_is_literal" json:"code_is_literal"`
CodeIsInt bool `yaml:"code_is_int" json:"code_is_int"`
Path string `yaml:"path" json:"path"`
}
type InfoAll struct {
Entries []Info `yaml:"entries" json:"entries"` // raw entries
LiteralCodes map[string][]Info `yaml:"literal_codes" json:"literal_codes"` // entries with literal codes
CallExprCodes []Info `yaml:"call_expr_codes" json:"call_expr_codes"` // entries with call expressions
DeprecatedNewDefault []string `yaml:"deprecated_new_default" json:"deprecated_new_default" ` // list of files with usage of deprecated NewDefault func
Errors map[string][]Error `yaml:"errors_raw" json:"errors_raw"` // map of detected errors created using errors.New(...). The key is the error name, more than 1 entry in the list is a duplication error.
}
func NewInfoAll() *InfoAll {
return &InfoAll{
Entries: []Info{},
LiteralCodes: make(map[string][]Info),
CallExprCodes: []Info{},
DeprecatedNewDefault: []string{},
Errors: map[string][]Error{}}
}