func (p *Package) UnmarshalJSON(data []byte) error {
	doc := &jsonPackage{}
	if err := json.Unmarshal(data, &doc); err != nil {
		return err
	}
	if doc.Version < LowestVersion {
		return errors.Errorf("package version %d < %d", doc.Version, LowestVersion)
	}
	*p = Package(doc.packageAlias)
	return p.Validate()
}
// UnmarshalJSON satisfies the json.Unmarshaler interface.
UnmarshalJSON satisfies the json.Unmarshaler interface.
// UnmarshalJSON satisfies the json . Unmarshaler interface .
func (p *Package) UnmarshalJSON(data []byte) error {
	doc := &jsonPackage{}
	if err := json.Unmarshal(data, &doc); err != nil {
		return err
	}
	if doc.Version < LowestVersion {
		return errors.Errorf("package version %d < %d", doc.Version, LowestVersion)
	}
	*p = Package(doc.packageAlias)
	return p.Validate()
}
func ( p * Package ) UnmarshalJSON ( data [ ] byte ) error { doc := & jsonPackage { } if err := json . Unmarshal ( data , & doc ) ; err != nil { return err } if doc . Version < LowestVersion { return errors . Errorf ( " " , doc . Version , LowestVersion ) } * p = Package ( doc . packageAlias ) return p . Validate ( ) }
UnmarshalJSON satisfies the json.Unmarshaler interface.
UnmarshalJSON satisfies the json . Unmarshaler interface .