equal
deleted
inserted
replaced
160 result = result + "/" + jid.Resource |
160 result = result + "/" + jid.Resource |
161 } |
161 } |
162 return result |
162 return result |
163 } |
163 } |
164 |
164 |
165 // Set implements flag.Value. It returns true if it successfully |
165 // Set implements flag.Value. |
166 // parses the string. |
|
167 func (jid *JID) Set(val string) error { |
166 func (jid *JID) Set(val string) error { |
168 r := regexp.MustCompile("^(([^@/]+)@)?([^@/]+)(/([^@/]+))?$") |
167 r := regexp.MustCompile("^(([^@/]+)@)?([^@/]+)(/([^@/]+))?$") |
169 parts := r.FindStringSubmatch(val) |
168 parts := r.FindStringSubmatch(val) |
170 if parts == nil { |
169 if parts == nil { |
171 return fmt.Errorf("%s doesn't match user@domain/resource", val) |
170 return fmt.Errorf("%s doesn't match user@domain/resource", val) |