MCPcopy
hub / github.com/rs/zerolog / hasBadFinisher

Function hasBadFinisher

cmd/lint/lint.go:124–158  ·  view source on GitHub ↗
(p *loader.Program, s selection)

Source from the content-addressed store, hash-verified

122}
123
124func hasBadFinisher(p *loader.Program, s selection) bool {
125 pkgPath := strings.TrimPrefix(s.pkg.Path(), rootPkg+"/vendor/")
126 absoluteFilePath := strings.TrimPrefix(p.Fset.File(s.Pos()).Name(), rootPkg+"/vendor/")
127 goFilePath := pkgPath + "/" + filepath.Base(p.Fset.Position(s.Pos()).Filename)
128
129 for _, f := range allowedFinishers {
130 if f == s.fn.Name() {
131 return false
132 }
133 }
134
135 for _, ignoredPkg := range recursivelyIgnoredPkgs {
136 if strings.HasPrefix(pkgPath, ignoredPkg) {
137 return false
138 }
139 }
140
141 for _, ignoredPkg := range ignoredPkgs {
142 if pkgPath == ignoredPkg {
143 return false
144 }
145 }
146
147 for _, ignoredFile := range ignoredFiles {
148 if absoluteFilePath == ignoredFile {
149 return false
150 }
151
152 if goFilePath == ignoredFile {
153 return false
154 }
155 }
156
157 return true
158}
159
160type arrayFlag []string
161

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected