Documentation
¶
Overview ¶
Package tag provides useful features for manipulating struct field tags.
This is based mostly on stdlib code, copyright 2009 The Go Authors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Lookup looks up values in a struct tag, which by convention is a sequence of key:"value" pairs, optionally separated by whitespace. See reflect.StructTag.
Note that, unlike the Go parser and reflect package, struct tag strings in morph are not enclosed with a quote pair like a Go string literal. The input to this function is unquoted.
It returns the value associated with key in the tag string. If the key is present in the tag the value (which may be empty) is returned. Otherwise, the returned value will be the empty string. The ok return value reports whether the value was explicitly set in the tag string. If the tag does not have the conventional format, the value returned by Lookup is unspecified.
func NextPair ¶
NextPair returns the next key, value, and remaining tag in a struct tag string.
Note that, unlike the Go parser and reflect package, struct tag strings in morph are not enclosed with a quote pair like a Go string literal. The input to this function is unquoted.
The ok return value reports whether the value was explicitly set in the tag string. If the tag does not have the conventional format, the value returned by is unspecified.
func Quote ¶
Quote is like strconv.Quote, but uses backticks instead of double quotes.
Types ¶
This section is empty.