github.com/kaisawind/go-swagger@v0.19.0/generator/templates/validation/customformat.gotmpl (about)

     1  {{ if ne .SwaggerFormat "byte" -}}
     2    {{- if .IsAliased }}
     3    if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{ .AliasedType }}({{.ValueExpression }}).String(), formats); err != nil {
     4    {{- else }}
     5    if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{.ValueExpression }}.String(), formats); err != nil {
     6    {{- end }}
     7    return err
     8    }
     9  {{- else }}
    10    // Format "byte" (base64 string) is already validated when unmarshalled
    11  {{- end }}