github.com/6543-forks/go-swagger@v0.26.0/generator/templates/validation/customformat.gotmpl (about)

     1  {{- if .IsAliased }}
     2    if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{ .AliasedType }}({{.ValueExpression }}).String(), formats); err != nil {
     3  {{- else }}
     4    if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{.ValueExpression }}.String(), formats); err != nil {
     5  {{- end }}
     6    return err
     7    }