Skip to content

Commit 2948b49

Browse files
committed
chore: update docs
1 parent d5fed37 commit 2948b49

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

container_manager/volume.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ package containermanger
22

33
import (
44
"errors"
5-
"fmt"
6-
75
"github.com/docker/docker/api/types/volume"
86
)
97

10-
// Create a new volume, return id of the volume
8+
// CreateVolume : Create a new volume, return id of the volume
119
func (m Manager) CreateVolume(name string) error {
1210
_, err := m.client.VolumeCreate(m.ctx, volume.CreateOptions{
1311
Name: name,
@@ -18,7 +16,7 @@ func (m Manager) CreateVolume(name string) error {
1816
return nil
1917
}
2018

21-
// Remove a volume by id
19+
// RemoveVolume : Remove a volume by id
2220
func (m Manager) RemoveVolume(id string) error {
2321
err := m.client.VolumeRemove(m.ctx, id, true)
2422
if err != nil {
@@ -27,14 +25,13 @@ func (m Manager) RemoveVolume(id string) error {
2725
return nil
2826
}
2927

30-
// Check if volume exists
28+
// ExistsVolume : Check if volume exists
3129
func (m Manager) ExistsVolume(id string) bool {
32-
d, err := m.client.VolumeInspect(m.ctx, id)
33-
fmt.Println(d)
30+
_, err := m.client.VolumeInspect(m.ctx, id)
3431
return err == nil
3532
}
3633

37-
// Fetch all volumes
34+
// FetchVolumes Fetch all volumes
3835
func (m Manager) FetchVolumes() ([]string, error) {
3936
volumes, err := m.client.VolumeList(m.ctx, volume.ListOptions{})
4037
if err != nil {

0 commit comments

Comments
 (0)