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

transport/channel.go: Adding Channel.Is()

This commit is contained in:
Henrik Hautakoski 2023-03-07 11:58:03 +01:00
parent 7358bebc76
commit 8e99146cc2

View file

@ -20,6 +20,21 @@ func (c Channel) String() string {
return strings.Join(c, "/")
}
// Check if two channels are equal
func (c Channel) Is(other Channel) bool {
if len(c) != len(other) {
return false
}
for i, item := range c {
if item != other[i] {
return false
}
}
return true
}
// Define channels without any variables.
var (
TransactionChannel = Channel{"transaction"}