SA9002: detect fs.FileMode in addition to os.FileMode
Go 1.16 delcares os.FileMode as an alias for fs.FileMode, which broke
our check.
@@ -2926,7 +2926,8 @@ func CheckNonOctalFileMode(pass *analysis.Pass) (interface{}, error) {
if !ok {
continue
}
- if !typeutil.IsType(pass.TypesInfo.TypeOf(lit), "os.FileMode") {
+ if !typeutil.IsType(pass.TypesInfo.TypeOf(lit), "os.FileMode") &&
+ !typeutil.IsType(pass.TypesInfo.TypeOf(lit), "io/fs.FileMode") {
continue
}
if len(lit.Value) == 3 &&
