mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
21 lines
435 B
Go
21 lines
435 B
Go
package entity
|
|
|
|
import "strings"
|
|
|
|
// RefsToIds parse a slice of git references and return the corresponding Entity's Id.
|
|
func RefsToIds(refs []string) []Id {
|
|
ids := make([]Id, len(refs))
|
|
|
|
for i, ref := range refs {
|
|
ids[i] = RefToId(ref)
|
|
}
|
|
|
|
return ids
|
|
}
|
|
|
|
// RefsToIds parse a git reference and return the corresponding Entity's Id.
|
|
func RefToId(ref string) Id {
|
|
split := strings.Split(ref, "/")
|
|
return Id(split[len(split)-1])
|
|
}
|