func parse(raw string, key, secret *string) error { fields, err := stringutil.SplitFieldsOptions(raw, ":", &stringutil.SplitOptions{ExactCount: 2}) if err != nil { return err } *key = fields[0] *secret = fields[1] return nil }
func (a *Account) Parse(raw string) error { fields, err := stringutil.SplitFieldsOptions(raw, ":", &stringutil.SplitOptions{ExactCount: 2}) if err != nil { return err } a.Username = fields[0] a.Password = fields[1] return nil }