INNER CODE UNIT · Go
shortenType
VladRassokhin/intellij-hcl · schemas-extractor/template/generate-schema.go:136
func shortenType(value string) string {
if (len(value) > 4 && value[0:4] == "Type") {
return value[4:]
}
return value
}
func exportValue(value interface{}, t string) *SchemaElement {
s2, ok := value.(*schema.Schema)
if ok {
return &SchemaElement{Type: "SchemaElements", ElementsType: shortenType(fmt.Sprintf("%s", s2.Type))}
}
r2, ok := value.(*schema.Resource)
if ok {
return &SchemaElement{Type: "SchemaInfo", Info: ExportResource(r2)}
}
vt, ok := value.(schema.ValueType)
if ok {