From a38fbf289f45d997250cc212518ab71194fd1e19 Mon Sep 17 00:00:00 2001 From: Ruslan Semagin Date: Thu, 19 Feb 2026 11:10:37 +0300 Subject: [PATCH] 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. --- pkg/constants/channels.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/constants/channels.go b/pkg/constants/channels.go index 3e3df3839..b0435b407 100644 --- a/pkg/constants/channels.go +++ b/pkg/constants/channels.go @@ -1,15 +1,16 @@ // Package constants provides shared constants across the codebase. package constants -// InternalChannels defines channels that are used for internal communication +// 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]bool{ - "cli": true, - "system": true, - "subagent": true, +var internalChannels = map[string]struct{}{ + "cli": {}, + "system": {}, + "subagent": {}, } // IsInternalChannel returns true if the channel is an internal channel. func IsInternalChannel(channel string) bool { - return InternalChannels[channel] + _, ok := internalChannels[channel] + return ok }