Skip to content

Commit e0b1ab6

Browse files
committed
cli/command/container: fix use of generics
This was introduced in dad1d36, which did not add a `//go:build` constraint to enable the use of generics (`any`). Which causes an error when used; could not import github.com/docker/cli/cli/command/container (-: # github.com/docker/cli/cli/command/container /Users/thajeztah/go/pkg/mod/github.com/docker/[email protected]+incompatible/cli/command/container/stats.go:148:39: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 30d597d commit e0b1ab6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cli/command/container/stats.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions)
145145
eh.setHandler(events.ActionCreate, func(e events.Message) {
146146
if s := NewStats(e.Actor.ID); cStats.add(s) {
147147
waitFirst.Add(1)
148-
log.G(ctx).WithFields(map[string]any{
148+
log.G(ctx).WithFields(log.Fields{
149149
"event": e.Action,
150150
"container": e.Actor.ID,
151151
}).Debug("collecting stats for container")
@@ -157,7 +157,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions)
157157
eh.setHandler(events.ActionStart, func(e events.Message) {
158158
if s := NewStats(e.Actor.ID); cStats.add(s) {
159159
waitFirst.Add(1)
160-
log.G(ctx).WithFields(map[string]any{
160+
log.G(ctx).WithFields(log.Fields{
161161
"event": e.Action,
162162
"container": e.Actor.ID,
163163
}).Debug("collecting stats for container")
@@ -167,7 +167,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions)
167167

168168
if !options.All {
169169
eh.setHandler(events.ActionDie, func(e events.Message) {
170-
log.G(ctx).WithFields(map[string]any{
170+
log.G(ctx).WithFields(log.Fields{
171171
"event": e.Action,
172172
"container": e.Actor.ID,
173173
}).Debug("stop collecting stats for container")
@@ -232,7 +232,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions)
232232
for _, ctr := range cs.Items {
233233
if s := NewStats(ctr.ID); cStats.add(s) {
234234
waitFirst.Add(1)
235-
log.G(ctx).WithFields(map[string]any{
235+
log.G(ctx).WithFields(log.Fields{
236236
"container": ctr.ID,
237237
}).Debug("collecting stats for container")
238238
go collect(ctx, s, apiClient, !options.NoStream, waitFirst)
@@ -255,7 +255,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions)
255255
for _, ctr := range options.Containers {
256256
if s := NewStats(ctr); cStats.add(s) {
257257
waitFirst.Add(1)
258-
log.G(ctx).WithFields(map[string]any{
258+
log.G(ctx).WithFields(log.Fields{
259259
"container": ctr,
260260
}).Debug("collecting stats for container")
261261
go collect(ctx, s, apiClient, !options.NoStream, waitFirst)

0 commit comments

Comments
 (0)