Skip to content

Commit 7fe020e

Browse files
committed
chore(agent): add consts for connection version on listen
1 parent 58b86c5 commit 7fe020e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

agent/agent.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,18 @@ func (a *Agent) Close() error {
377377
return (*l).Close()
378378
}
379379

380+
const (
381+
ConnectionV1 = 1
382+
ConnectionV2 = 2
383+
)
384+
380385
func (a *Agent) Listen(ctx context.Context) error {
381386
a.mode.Serve(a)
382387

383388
switch a.config.ConnectionVersion {
384-
case 1:
389+
case ConnectionV1:
385390
return a.listenV1(ctx)
386-
case 2:
391+
case ConnectionV2:
387392
return a.listenV2(ctx)
388393
default:
389394
return fmt.Errorf("unsupported connection version: %d", a.config.ConnectionVersion)

0 commit comments

Comments
 (0)