aboutsummaryrefslogtreecommitdiffstats
path: root/entity/refs.go
diff options
context:
space:
mode:
Diffstat (limited to 'entity/refs.go')
-rw-r--r--entity/refs.go18
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])
+}