MCPcopy Index your code
hub / github.com/coder/coder / push

Method push

cli/ssh.go:1425–1438  ·  view source on GitHub ↗
(name string, closer io.Closer)

Source from the content-addressed store, hash-verified

1423}
1424
1425func (c *closerStack) push(name string, closer io.Closer) error {
1426 c.Lock()
1427 if c.closed {
1428 c.Unlock()
1429 // since we're refusing to push it on the stack, close it now
1430 err := closer.Close()
1431 c.logger.Error(context.Background(),
1432 "closed item rejected push", slog.F("name", name), slog.Error(err))
1433 return xerrors.Errorf("already closed: %w", c.err)
1434 }
1435 c.closers = append(c.closers, closerWithName{name: name, closer: closer})
1436 c.Unlock()
1437 return nil
1438}
1439
1440// rawSSHCopier handles copying raw SSH data between the conn and the pair (r, w).
1441type rawSSHCopier struct {

Callers 15

TestCloserStack_MainlineFunction · 0.80
TestCloserStack_ContextFunction · 0.80
TestCloserStack_TimeoutFunction · 0.80
sshMethod · 0.80
runCoderConnectStdioFunction · 0.80
organizeAgentAppsFunction · 0.80
getAgentHealthIssuesFunction · 0.80

Calls 5

CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by 13

TestCloserStack_MainlineFunction · 0.64
TestCloserStack_ContextFunction · 0.64
TestCloserStack_TimeoutFunction · 0.64
constructorMethod · 0.64
createMockSocketFunction · 0.64
makeReconnectFunction · 0.64
convertToBlobMethod · 0.64
constructorMethod · 0.64