Skip to content

Commit

Permalink
feat: add key as var in checkHTTPMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed Sep 18, 2022
1 parent 63a9d66 commit df5e279
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/analyzer/analyzer.go
Expand Up @@ -364,7 +364,9 @@ func lookupFlag(pass *analysis.Pass, name string) bool {
func checkHTTPMethod(pass *analysis.Pass, basicLit *ast.BasicLit) {
currentVal := getBasicLitValue(basicLit)

if newVal, ok := mapping.HTTPMethod[strings.ToUpper(currentVal)]; ok {
key := strings.ToUpper(currentVal)

if newVal, ok := mapping.HTTPMethod[key]; ok {
report(pass, basicLit.Pos(), currentVal, newVal)
}
}
Expand Down

0 comments on commit df5e279

Please sign in to comment.