Skip to content

Commit

Permalink
Remove built-in types that existing only for the Go documentation (mg…
Browse files Browse the repository at this point in the history
…echev#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 <subham@deepsource.io>
  • Loading branch information
zimmski authored and subham-deepsource committed Aug 5, 2022
1 parent 03885b0 commit 7bc976f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
47 changes: 21 additions & 26 deletions rule/redefines-builtin-id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion testdata/redefines-builtin-id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7bc976f

Please sign in to comment.