Skip to content

Commit 670f438

Browse files
zimmskisubham-deepsource
authored andcommitted
Remove built-in types that existing only for the Go documentation (mgechev#675)
Since these types only exist for documenting Go's standard library there should be no reason to mark them. Closes mgechev#673 Signed-off-by: subham sarkar <[email protected]>
1 parent 86f52ac commit 670f438

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

rule/redefines-builtin-id.go

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,27 @@ var builtFunctions = map[string]bool{
3434
}
3535

3636
var builtInTypes = map[string]bool{
37-
"ComplexType": true,
38-
"FloatType": true,
39-
"IntegerType": true,
40-
"Type": true,
41-
"Type1": true,
42-
"bool": true,
43-
"byte": true,
44-
"complex128": true,
45-
"complex64": true,
46-
"error": true,
47-
"float32": true,
48-
"float64": true,
49-
"int": true,
50-
"int16": true,
51-
"int32": true,
52-
"int64": true,
53-
"int8": true,
54-
"rune": true,
55-
"string": true,
56-
"uint": true,
57-
"uint16": true,
58-
"uint32": true,
59-
"uint64": true,
60-
"uint8": true,
61-
"uintptr": true,
62-
"any": true,
37+
"bool": true,
38+
"byte": true,
39+
"complex128": true,
40+
"complex64": true,
41+
"error": true,
42+
"float32": true,
43+
"float64": true,
44+
"int": true,
45+
"int16": true,
46+
"int32": true,
47+
"int64": true,
48+
"int8": true,
49+
"rune": true,
50+
"string": true,
51+
"uint": true,
52+
"uint16": true,
53+
"uint32": true,
54+
"uint64": true,
55+
"uint8": true,
56+
"uintptr": true,
57+
"any": true,
6358
}
6459

6560
// RedefinesBuiltinIDRule warns when a builtin identifier is shadowed.

testdata/redefines-builtin-id.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func append(i, j int) { // MATCH /redefinition of the built-in function append/
99

1010
}
1111

12-
type Type int16 // MATCH /redefinition of the built-in type Type/
12+
type string int16 // MATCH /redefinition of the built-in type string/
1313

1414
func delete(set []int64, i int) (y []int64) { // MATCH /redefinition of the built-in function delete/
1515
for j, v := range set {

0 commit comments

Comments
 (0)