func (p *Package) MarshalJSON() ([]byte, error) {
	if err := p.Validate(); err != nil {
		return nil, err
	}
	doc := jsonPackage{
		Version:      CurrentVersion,
		packageAlias: packageAlias(*p),
	}
	return json.Marshal(doc)
}
// MarshalJSON implements the json.Marshaler interface for the Package type.
MarshalJSON implements the json.Marshaler interface for the Package type.
// MarshalJSON implements the json . Marshaler interface for the Package type .
func (p *Package) MarshalJSON() ([]byte, error) {
	if err := p.Validate(); err != nil {
		return nil, err
	}
	doc := jsonPackage{
		Version:      CurrentVersion,
		packageAlias: packageAlias(*p),
	}
	return json.Marshal(doc)
}
func ( p * Package ) MarshalJSON ( ) ( [ ] byte , error ) { if err := p . Validate ( ) ; err != nil { return nil , err } doc := jsonPackage { Version : CurrentVersion , packageAlias : packageAlias ( * p ) , } return json . Marshal ( doc ) }
MarshalJSON implements the json.Marshaler interface for the Package type.
MarshalJSON implements the json . Marshaler interface for the Package type .