1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-19 04:50:02 +02:00

api/channel.go: Adding Channel.Type()

This commit is contained in:
Henrik Hautakoski 2023-05-26 14:05:16 +02:00
parent 47dda7a3f4
commit 9e586d879d
2 changed files with 27 additions and 0 deletions

View file

@ -19,6 +19,13 @@ func (c Channel) String() string {
return c.Format("/")
}
func (c Channel) Type() string {
if len(c) > 0 {
return c[0]
}
return "unknown"
}
// Check if two channels are equal
func (c Channel) Is(other Channel) bool {
if len(c) != len(other) {