@@ -532,7 +532,6 @@ func checkPrintf(pass *analysis.Pass, kind Kind, call *ast.CallExpr, name string
532
532
if err != nil {
533
533
// All error messages are in predicate form ("call has a problem")
534
534
// so that they may be affixed into a subject ("log.Printf ").
535
- // See https://go-review.googlesource.com/c/tools/+/632598/comment/9d980373_e6460abf/
536
535
pass .ReportRangef (call .Args [idx ], "%s %s" , name , err )
537
536
return
538
537
}
@@ -697,7 +696,7 @@ func okPrintfArg(pass *analysis.Pass, call *ast.CallExpr, maxArgIndex *int, firs
697
696
if reason != "" {
698
697
details = " (" + reason + ")"
699
698
}
700
- pass .ReportRangef (call , "%s format %s uses non-int %s%s as argument of *" , name , operation .Text , analysisutil .Format (pass .Fset , arg ), details )
699
+ pass .ReportRangef (call , "%s format %s uses non-int %s%s as argument of *" , name , operation .Text , analysisinternal .Format (pass .Fset , arg ), details )
701
700
return false
702
701
}
703
702
}
@@ -724,7 +723,7 @@ func okPrintfArg(pass *analysis.Pass, call *ast.CallExpr, maxArgIndex *int, firs
724
723
}
725
724
arg := call .Args [verbArgIndex ]
726
725
if isFunctionValue (pass , arg ) && verb != 'p' && verb != 'T' {
727
- pass .ReportRangef (call , "%s format %s arg %s is a func value, not called" , name , operation .Text , analysisutil .Format (pass .Fset , arg ))
726
+ pass .ReportRangef (call , "%s format %s arg %s is a func value, not called" , name , operation .Text , analysisinternal .Format (pass .Fset , arg ))
728
727
return false
729
728
}
730
729
if reason , ok := matchArgType (pass , v .typ , arg ); ! ok {
@@ -736,12 +735,12 @@ func okPrintfArg(pass *analysis.Pass, call *ast.CallExpr, maxArgIndex *int, firs
736
735
if reason != "" {
737
736
details = " (" + reason + ")"
738
737
}
739
- pass .ReportRangef (call , "%s format %s has arg %s of wrong type %s%s" , name , operation .Text , analysisutil .Format (pass .Fset , arg ), typeString , details )
738
+ pass .ReportRangef (call , "%s format %s has arg %s of wrong type %s%s" , name , operation .Text , analysisinternal .Format (pass .Fset , arg ), typeString , details )
740
739
return false
741
740
}
742
741
if v .typ & argString != 0 && v .verb != 'T' && ! strings .Contains (operation .Flags , "#" ) {
743
742
if methodName , ok := recursiveStringer (pass , arg ); ok {
744
- pass .ReportRangef (call , "%s format %s with arg %s causes recursive %s method call" , name , operation .Text , analysisutil .Format (pass .Fset , arg ), methodName )
743
+ pass .ReportRangef (call , "%s format %s with arg %s causes recursive %s method call" , name , operation .Text , analysisinternal .Format (pass .Fset , arg ), methodName )
745
744
return false
746
745
}
747
746
}
@@ -893,7 +892,7 @@ func checkPrint(pass *analysis.Pass, call *ast.CallExpr, name string) {
893
892
if sel , ok := call .Args [0 ].(* ast.SelectorExpr ); ok {
894
893
if x , ok := sel .X .(* ast.Ident ); ok {
895
894
if x .Name == "os" && strings .HasPrefix (sel .Sel .Name , "Std" ) {
896
- pass .ReportRangef (call , "%s does not take io.Writer but has first arg %s" , name , analysisutil .Format (pass .Fset , call .Args [0 ]))
895
+ pass .ReportRangef (call , "%s does not take io.Writer but has first arg %s" , name , analysisinternal .Format (pass .Fset , call .Args [0 ]))
897
896
}
898
897
}
899
898
}
@@ -922,10 +921,10 @@ func checkPrint(pass *analysis.Pass, call *ast.CallExpr, name string) {
922
921
}
923
922
for _ , arg := range args {
924
923
if isFunctionValue (pass , arg ) {
925
- pass .ReportRangef (call , "%s arg %s is a func value, not called" , name , analysisutil .Format (pass .Fset , arg ))
924
+ pass .ReportRangef (call , "%s arg %s is a func value, not called" , name , analysisinternal .Format (pass .Fset , arg ))
926
925
}
927
926
if methodName , ok := recursiveStringer (pass , arg ); ok {
928
- pass .ReportRangef (call , "%s arg %s causes recursive call to %s method" , name , analysisutil .Format (pass .Fset , arg ), methodName )
927
+ pass .ReportRangef (call , "%s arg %s causes recursive call to %s method" , name , analysisinternal .Format (pass .Fset , arg ), methodName )
929
928
}
930
929
}
931
930
}
0 commit comments