diff options
Diffstat (limited to 'entity')
-rw-r--r-- | entity/refs.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/entity/refs.go b/entity/refs.go new file mode 100644 index 00000000..82b1741b --- /dev/null +++ b/entity/refs.go @@ -0,0 +1,18 @@ +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]) +} |