Close ends the connection to the workspace agent.
()
| 185 | |
| 186 | // Close ends the connection to the workspace agent. |
| 187 | func (c *agentConn) Close() error { |
| 188 | var cerr error |
| 189 | if c.opts.CloseFunc != nil { |
| 190 | cerr = c.opts.CloseFunc() |
| 191 | if xerrors.Is(cerr, ErrSkipClose) { |
| 192 | return nil |
| 193 | } |
| 194 | } |
| 195 | if cerr != nil { |
| 196 | return multierror.Append(cerr, c.Conn.Close()) |
| 197 | } |
| 198 | return c.Conn.Close() |
| 199 | } |
| 200 | |
| 201 | // AgentReconnectingPTYInit initializes a new reconnecting PTY session. |
| 202 | // @typescript-ignore AgentReconnectingPTYInit |