mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
32c5c4b3a4
* refactor: replace bool map with set-style map for internal channels
Use map[string]struct{} and comma-ok idiom for clearer and more idiomatic membership checks.
* Update pkg/constants/channels.go
Co-authored-by: Harsh Bansal <122075346+harshbansal7@users.noreply.github.com>
---------
Co-authored-by: Harsh Bansal <122075346+harshbansal7@users.noreply.github.com>
17 lines
520 B
Go
17 lines
520 B
Go
// Package constants provides shared constants across the codebase.
|
|
package constants
|
|
|
|
// internalChannels defines channels that are used for internal communication
|
|
// and should not be exposed to external users or recorded as last active channel.
|
|
var internalChannels = map[string]struct{}{
|
|
"cli": {},
|
|
"system": {},
|
|
"subagent": {},
|
|
}
|
|
|
|
// IsInternalChannel returns true if the channel is an internal channel.
|
|
func IsInternalChannel(channel string) bool {
|
|
_, found := internalChannels[channel]
|
|
return found
|
|
}
|