INNER CODE UNIT · Go
getCheckTypeFromParsedBuiltinType
stackrox/kube-linter · pkg/templates/codegen/main.go:253
func getCheckTypeFromParsedBuiltinType(typeSpec *types.Type) (check.ParameterType, error) {
switch typeSpec {
case types.String:
return check.StringType, nil
case types.Int:
return check.IntegerType, nil
case types.Float32, types.Float64:
return check.NumberType, nil
case types.Bool:
return check.BooleanType, nil
default:
return "", fmt.Errorf("currently unsupported type %v", typeSpec)
}
}
func processTemplate(dir string) error {
b := parser.New()
// This avoids parsing generated files in the package (since we add +build !templatecodegen to them,