From 9921eb19274775baab006b11eda9abf69418e078 Mon Sep 17 00:00:00 2001 From: Markus Zimmermann Date: Fri, 8 Apr 2022 11:01:03 +0200 Subject: [PATCH] Remove built-in types that existing only for the Go documentation Since these types only exist for documenting Go's standard library there should be no reason to mark them. Closes #673 --- rule/redefines-builtin-id.go | 47 ++++++++++++++------------------ testdata/redefines-builtin-id.go | 2 +- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/rule/redefines-builtin-id.go b/rule/redefines-builtin-id.go index 62cb7b615..0f701514b 100644 --- a/rule/redefines-builtin-id.go +++ b/rule/redefines-builtin-id.go @@ -34,32 +34,27 @@ var builtFunctions = map[string]bool{ } var builtInTypes = map[string]bool{ - "ComplexType": true, - "FloatType": true, - "IntegerType": true, - "Type": true, - "Type1": true, - "bool": true, - "byte": true, - "complex128": true, - "complex64": true, - "error": true, - "float32": true, - "float64": true, - "int": true, - "int16": true, - "int32": true, - "int64": true, - "int8": true, - "rune": true, - "string": true, - "uint": true, - "uint16": true, - "uint32": true, - "uint64": true, - "uint8": true, - "uintptr": true, - "any": true, + "bool": true, + "byte": true, + "complex128": true, + "complex64": true, + "error": true, + "float32": true, + "float64": true, + "int": true, + "int16": true, + "int32": true, + "int64": true, + "int8": true, + "rune": true, + "string": true, + "uint": true, + "uint16": true, + "uint32": true, + "uint64": true, + "uint8": true, + "uintptr": true, + "any": true, } // RedefinesBuiltinIDRule warns when a builtin identifier is shadowed. diff --git a/testdata/redefines-builtin-id.go b/testdata/redefines-builtin-id.go index 86545235b..059379903 100644 --- a/testdata/redefines-builtin-id.go +++ b/testdata/redefines-builtin-id.go @@ -9,7 +9,7 @@ func append(i, j int) { // MATCH /redefinition of the built-in function append/ } -type Type int16 // MATCH /redefinition of the built-in type Type/ +type string int16 // MATCH /redefinition of the built-in type string/ func delete(set []int64, i int) (y []int64) { // MATCH /redefinition of the built-in function delete/ for j, v := range set {