aboutsummaryrefslogtreecommitdiffstats
path: root/entity/refs.go
blob: f505dbf01ee99480d9ddc349b1113ff510cf74ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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])
}