func (info *Info) Validate() error {
	if len(info.Addrs) == 0 {
		return errors.NotValidf("missing addresses")
	}

	for _, addr := range info.Addrs {
		_, err := network.ParseMachineHostPort(addr)
		if err != nil {
			return errors.NotValidf("host addresses: %v", err)
		}
	}

	if info.SkipLogin {
		if info.Tag != nil {
			return errors.NotValidf("specifying Tag and SkipLogin")
		}
		if info.Password != "" {
			return errors.NotValidf("specifying Password and SkipLogin")
		}
		if len(info.Macaroons) > 0 {
			return errors.NotValidf("specifying Macaroons and SkipLogin")
		}
	}
	return nil
}
// Validate validates the API info.
Validate validates the API info.
// Validate validates the API info .
func (info *Info) Validate() error {
	if len(info.Addrs) == 0 {
		return errors.NotValidf("missing addresses")
	}
	for _, addr := range info.Addrs {
		_, err := network.ParseMachineHostPort(addr)
		if err != nil {
			return errors.NotValidf("host addresses: %v", err)
		}
	}
	if info.SkipLogin {
		if info.Tag != nil {
			return errors.NotValidf("specifying Tag and SkipLogin")
		}
		if info.Password != "" {
			return errors.NotValidf("specifying Password and SkipLogin")
		}
		if len(info.Macaroons) > 0 {
			return errors.NotValidf("specifying Macaroons and SkipLogin")
		}
	}
	return nil
}
func ( info * Info ) Validate ( ) error { if len ( info . Addrs ) == 0 { return errors . NotValidf ( " " ) } for _ , addr := range info . Addrs { _ , err := network . ParseMachineHostPort ( addr ) if err != nil { return errors . NotValidf ( " " , err ) } } if info . SkipLogin { if info . Tag != nil { return errors . NotValidf ( " " ) } if info . Password != " " { return errors . NotValidf ( " " ) } if len ( info . Macaroons ) > 0 { return errors . NotValidf ( " " ) } } return nil }
Validate validates the API info.
Validate validates the API info .