MCPcopy Create free account
hub / github.com/cli/cli / Close

Method Close

internal/codespaces/rpc/invoker.go:151–161  ·  view source on GitHub ↗

Closes the gRPC connection

()

Source from the content-addressed store, hash-verified

149
150// Closes the gRPC connection
151func (i *invoker) Close() error {
152 i.cancelPF()
153
154 // Closing the local listener effectively closes the gRPC connection
155 if err := i.listener.Close(); err != nil {
156 i.conn.Close() // If we fail to close the listener, explicitly close the gRPC connection and ignore any error
157 return fmt.Errorf("failed to close local tcp port listener: %w", err)
158 }
159
160 return nil
161}
162
163// Appends the authentication token to the gRPC context
164func (i *invoker) appendMetadata(ctx context.Context) context.Context {

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected