Skip to content

Commit 968526d

Browse files
committed
Remove unused fn
🤦
1 parent 57f464a commit 968526d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

agent/reconnectingpty/buffered.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (rpty *bufferedReconnectingPTY) lifecycle(ctx context.Context, logger slog.
132132
logger.Debug(ctx, "reconnecting pty ready")
133133
rpty.state.setState(StateReady, nil)
134134

135-
state, reasonErr := rpty.state.waitForStateOrContext(ctx, StateClosing, nil)
135+
state, reasonErr := rpty.state.waitForStateOrContext(ctx, StateClosing)
136136
if state < StateClosing {
137137
// If we have not closed yet then the context is what unblocked us (which
138138
// means the agent is shutting down) so move into the closing phase.

agent/reconnectingpty/reconnectingpty.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (s *ptyState) waitForState(state State) (State, error) {
168168

169169
// waitForStateOrContext blocks until the state or a greater one is reached or
170170
// the provided context ends.
171-
func (s *ptyState) waitForStateOrContext(ctx context.Context, state State, fn func(state State) error) (State, error) {
171+
func (s *ptyState) waitForStateOrContext(ctx context.Context, state State) (State, error) {
172172
s.cond.L.Lock()
173173
defer s.cond.L.Unlock()
174174
return s.waitForStateOrContextLocked(ctx, state)

agent/reconnectingpty/screen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (rpty *screenReconnectingPTY) lifecycle(ctx context.Context, logger slog.Lo
130130
logger.Debug(ctx, "reconnecting pty ready")
131131
rpty.state.setState(StateReady, nil)
132132

133-
state, reasonErr := rpty.state.waitForStateOrContext(ctx, StateClosing, nil)
133+
state, reasonErr := rpty.state.waitForStateOrContext(ctx, StateClosing)
134134
if state < StateClosing {
135135
// If we have not closed yet then the context is what unblocked us (which
136136
// means the agent is shutting down) so move into the closing phase.
@@ -155,7 +155,7 @@ func (rpty *screenReconnectingPTY) Attach(ctx context.Context, _ string, conn ne
155155
ctx, cancel := context.WithCancel(ctx)
156156
defer cancel()
157157

158-
state, err := rpty.state.waitForStateOrContext(ctx, StateReady, nil)
158+
state, err := rpty.state.waitForStateOrContext(ctx, StateReady)
159159
if state != StateReady {
160160
return xerrors.Errorf("reconnecting pty ready wait: %w", err)
161161
}

0 commit comments

Comments
 (0)