change zone type name to zonename

This should make it more obvious for what this type is intended.
This commit is contained in:
Gibheer 2021-04-24 21:36:11 +02:00
parent 3f04987290
commit 61d7ed2536
1 changed files with 3 additions and 3 deletions

View File

@ -7,15 +7,15 @@ import (
type ( type (
// Zone represents the name of a zone. A zone must end with a `.`. // 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, `"`) in = bytes.Trim(in, `"`)
if in[len(in)-1] != '.' { if in[len(in)-1] != '.' {
return fmt.Errorf("not a valid zone name") return fmt.Errorf("not a valid zone name")
} }
*z = Zone(in) *z = ZoneName(in)
return nil return nil
} }