Skip to content

Commit ada18fb

Browse files
committed
refactor(markerscope): simplify getBasicTypeSchema with nolint:exhaustive
Signed-off-by: nayuta-ai <nayuta723@gmail.com>
1 parent c4f233b commit ada18fb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/analysis/markerscope/schema.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func getSchemaType(t types.Type) SchemaType {
6161

6262
// getBasicTypeSchema returns the schema type for a basic Go type.
6363
func getBasicTypeSchema(bt *types.Basic) SchemaType {
64+
//nolint:exhaustive // Only supporting OpenAPI-compatible types
6465
switch bt.Kind() {
6566
case types.Bool:
6667
return SchemaTypeBoolean
@@ -69,13 +70,8 @@ func getBasicTypeSchema(bt *types.Basic) SchemaType {
6970
return SchemaTypeInteger
7071
case types.String:
7172
return SchemaTypeString
72-
case types.Invalid, types.Uintptr, types.Float32, types.Float64,
73-
types.Complex64, types.Complex128, types.UnsafePointer,
74-
types.UntypedBool, types.UntypedInt, types.UntypedRune,
75-
types.UntypedFloat, types.UntypedComplex, types.UntypedString, types.UntypedNil:
76-
// These types are not supported in OpenAPI schemas
77-
return ""
7873
default:
74+
// Other types (float, complex, unsafe, untyped) are not supported in OpenAPI schemas
7975
return ""
8076
}
8177
}

0 commit comments

Comments
 (0)