Skip to content

Commit 2f5f0af

Browse files
committed
Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
1 parent 709bf8b commit 2f5f0af

File tree

23 files changed

+31
-34
lines changed

23 files changed

+31
-34
lines changed

api/server/router/container/container_routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (s *containerRouter) getContainersStats(ctx context.Context, w http.Respons
7070
config := &backend.ContainerStatsConfig{
7171
Stream: stream,
7272
OutStream: w,
73-
Version: string(httputils.VersionFromContext(ctx)),
73+
Version: httputils.VersionFromContext(ctx),
7474
}
7575

7676
return s.backend.ContainerStats(ctx, vars["name"], config)

api/server/router/image/image_routes.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ func (s *imageRouter) postCommit(ctx context.Context, w http.ResponseWriter, r *
6666
return err
6767
}
6868

69-
return httputils.WriteJSON(w, http.StatusCreated, &types.IDResponse{
70-
ID: string(imgID),
71-
})
69+
return httputils.WriteJSON(w, http.StatusCreated, &types.IDResponse{ID: imgID})
7270
}
7371

7472
// Creates an image from Pull or from Import

builder/dockerfile/dispatchers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ func parseOptInterval(f *Flag) (time.Duration, error) {
551551
if err != nil {
552552
return 0, err
553553
}
554-
if d < time.Duration(container.MinimumDuration) {
554+
if d < container.MinimumDuration {
555555
return 0, fmt.Errorf("Interval %#v cannot be less than %s", f.name, container.MinimumDuration)
556556
}
557557
return d, nil

builder/dockerfile/internals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (b *Builder) probeCache(dispatchState *dispatchState, runConfig *container.
243243
}
244244
fmt.Fprint(b.Stdout, " ---> Using cache\n")
245245

246-
dispatchState.imageID = string(cachedID)
246+
dispatchState.imageID = cachedID
247247
b.buildStages.update(dispatchState.imageID)
248248
return true, nil
249249
}

daemon/cluster/convert/swarm.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package convert
33
import (
44
"fmt"
55
"strings"
6-
"time"
76

87
types "github.com/docker/docker/api/types/swarm"
98
swarmapi "github.com/docker/swarmkit/api"
@@ -115,7 +114,7 @@ func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.Clu
115114
spec.Raft.ElectionTick = uint32(s.Raft.ElectionTick)
116115
}
117116
if s.Dispatcher.HeartbeatPeriod != 0 {
118-
spec.Dispatcher.HeartbeatPeriod = gogotypes.DurationProto(time.Duration(s.Dispatcher.HeartbeatPeriod))
117+
spec.Dispatcher.HeartbeatPeriod = gogotypes.DurationProto(s.Dispatcher.HeartbeatPeriod)
119118
}
120119
if s.CAConfig.NodeCertExpiry != 0 {
121120
spec.CAConfig.NodeCertExpiry = gogotypes.DurationProto(s.CAConfig.NodeCertExpiry)

daemon/cluster/executor/container/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ func (e *exitError) Error() string {
659659
}
660660

661661
func (e *exitError) ExitCode() int {
662-
return int(e.code)
662+
return e.code
663663
}
664664

665665
func (e *exitError) Cause() error {

daemon/graphdriver/overlay/copy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ func copyDir(srcDir, dstDir string, flags copyFlags) error {
158158

159159
// system.Chtimes doesn't support a NOFOLLOW flag atm
160160
if !isSymlink {
161-
aTime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))
162-
mTime := time.Unix(int64(stat.Mtim.Sec), int64(stat.Mtim.Nsec))
161+
aTime := time.Unix(stat.Atim.Sec, stat.Atim.Nsec)
162+
mTime := time.Unix(stat.Mtim.Sec, stat.Mtim.Nsec)
163163
if err := system.Chtimes(dstPath, aTime, mTime); err != nil {
164164
return err
165165
}

daemon/info.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
9797
drivers = strings.TrimSpace(drivers)
9898
v := &types.Info{
9999
ID: daemon.ID,
100-
Containers: int(cRunning + cPaused + cStopped),
101-
ContainersRunning: int(cRunning),
102-
ContainersPaused: int(cPaused),
103-
ContainersStopped: int(cStopped),
100+
Containers: cRunning + cPaused + cStopped,
101+
ContainersRunning: cRunning,
102+
ContainersPaused: cPaused,
103+
ContainersStopped: cStopped,
104104
Images: imageCount,
105105
Driver: drivers,
106106
DriverStatus: daemon.stores[p].layerStore.DriverStatus(),

daemon/listeners/listeners_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func listenFD(addr string, tlsConfig *tls.Config) ([]net.Listener, error) {
8686
return nil, fmt.Errorf("failed to parse systemd fd address: should be a number: %v", addr)
8787
}
8888
fdOffset := fdNum - 3
89-
if len(listeners) < int(fdOffset)+1 {
89+
if len(listeners) < fdOffset+1 {
9090
return nil, fmt.Errorf("too few socket activated files passed in by systemd")
9191
}
9292
if listeners[fdOffset] == nil {

daemon/oci_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
834834
s.Process.NoNewPrivileges = c.NoNewPrivileges
835835
s.Linux.MountLabel = c.MountLabel
836836

837-
return (*specs.Spec)(&s), nil
837+
return &s, nil
838838
}
839839

840840
func clearReadOnly(m *specs.Mount) {

0 commit comments

Comments
 (0)