Split splits a AnnotatedID into its ID and replica number parts.
()
| 252 | |
| 253 | // Split splits a AnnotatedID into its ID and replica number parts. |
| 254 | func (r AnnotatedID) Split() (string, int) { |
| 255 | split := strings.SplitN(string(r), "::", 2) |
| 256 | if len(split) != 2 { |
| 257 | return string(r), 0 |
| 258 | } |
| 259 | replica, _ := strconv.ParseInt(split[1], 10, 0) |
| 260 | return split[0], int(replica) |
| 261 | } |
| 262 | |
| 263 | // GetID returns just the ID part of the replicated ID |
| 264 | func (r AnnotatedID) GetID() string { |
no outgoing calls