git-bug/entity/refs.go
vince 647b05eee4
add remove identity feature
also adds:
- listlocalidentities
- refactors refstoids into entity package
2020-11-22 15:20:51 +01:00

19 lines
271 B
Go

package entity
import "strings"
func RefsToIds(refs []string) []Id {
ids := make([]Id, len(refs))
for i, ref := range refs {
ids[i] = refToId(ref)
}
return ids
}
func refToId(ref string) Id {
split := strings.Split(ref, "/")
return Id(split[len(split)-1])
}