change zone type name to zonename
This should make it more obvious for what this type is intended.
This commit is contained in:
parent
3f04987290
commit
61d7ed2536
|
@ -7,15 +7,15 @@ import (
|
|||
|
||||
type (
|
||||
// Zone represents the name of a zone. A zone must end with a `.`.
|
||||
Zone string
|
||||
ZoneName string
|
||||
)
|
||||
|
||||
func (z *Zone) UnmarshalJSON(in []byte) error {
|
||||
func (z *ZoneName) UnmarshalJSON(in []byte) error {
|
||||
in = bytes.Trim(in, `"`)
|
||||
|
||||
if in[len(in)-1] != '.' {
|
||||
return fmt.Errorf("not a valid zone name")
|
||||
}
|
||||
*z = Zone(in)
|
||||
*z = ZoneName(in)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue