refactor and typo fixes

This commit is contained in:
yusing
2024-11-02 03:14:47 +08:00
parent 76454df5e6
commit a86d316d07
34 changed files with 160 additions and 128 deletions

View File

@@ -52,13 +52,10 @@ func (c *SharedClient) Connected() bool {
}
// if the client is still referenced, this is no-op.
func (c *SharedClient) Close() error {
if !c.Connected() {
return nil
func (c *SharedClient) Close() {
if c.Connected() {
c.refCount.Sub()
}
c.refCount.Sub()
return nil
}
// ConnectClient creates a new Docker client connection to the specified host.
@@ -115,7 +112,6 @@ func ConnectClient(host string) (Client, error) {
}
client, err := client.NewClientWithOpts(opt...)
if err != nil {
return nil, err
}