Skip to content

Commit 5dbf71e

Browse files
authored
Apply suggestions from code review
1 parent a56462e commit 5dbf71e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

agent/containers_dockercli.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ func (*dockerCLIContainerLister) List(ctx context.Context) ([]codersdk.Workspace
3131
return nil, xerrors.Errorf("run docker ps: %w", err)
3232
}
3333

34-
// the output is returned with a single item per line, so we have to decode it
35-
// line-by-line
3634
ids := make([]string, 0)
3735
for _, line := range strings.Split(buf.String(), "\n") {
3836
tmp := strings.TrimSpace(line)
@@ -53,7 +51,6 @@ func (*dockerCLIContainerLister) List(ctx context.Context) ([]codersdk.Workspace
5351
return nil, xerrors.Errorf("run docker inspect: %w", err)
5452
}
5553

56-
// out := make([]codersdk.WorkspaceAgentContainer, 0)
5754
ins := make([]dockerInspect, 0)
5855
if err := json.NewDecoder(&buf).Decode(&ins); err != nil {
5956
return nil, xerrors.Errorf("decode docker inspect output: %w", err)
@@ -149,7 +146,6 @@ func convertDockerInspect(in dockerInspect) codersdk.WorkspaceAgentContainer {
149146

150147
// convertDockerPort converts a Docker port string to a port number and network
151148
// example: "8080/tcp" -> 8080, "tcp"
152-
//
153149
// "8080" -> 8080, "tcp"
154150
func convertDockerPort(in string) (uint16, string, error) {
155151
parts := strings.Split(in, "/")
@@ -176,7 +172,6 @@ func convertDockerPort(in string) (uint16, string, error) {
176172
// container path. If the host path is not specified, the container path is used
177173
// as the host path.
178174
// example: "/host/path=/container/path" -> "/host/path", "/container/path"
179-
//
180175
// "/container/path" -> "/container/path", "/container/path"
181176
func convertDockerVolume(in string) (hostPath, containerPath string) {
182177
parts := strings.Split(in, "=")

0 commit comments

Comments
 (0)