Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cli/command/config/formatter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25

package config

import (
"fmt"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -102,6 +106,7 @@ func (c *configContext) Labels() string {
for k, v := range mapLabels {
joinLabels = append(joinLabels, k+"="+v)
}
slices.Sort(joinLabels)
return strings.Join(joinLabels, ",")
}

Expand Down
5 changes: 5 additions & 0 deletions cli/command/formatter/volume.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25

package formatter

import (
"fmt"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -104,6 +108,7 @@ func (c *volumeContext) Labels() string {
for k, v := range c.v.Labels {
joinLabels = append(joinLabels, k+"="+v)
}
slices.Sort(joinLabels)
return strings.Join(joinLabels, ",")
}

Expand Down
4 changes: 1 addition & 3 deletions cli/command/formatter/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ func TestVolumeContext(t *testing.T) {
for _, c := range cases {
ctx = c.volumeCtx
v := c.call()
if strings.Contains(v, ",") {
test.CompareMultipleValues(t, v, c.expValue)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find on this one; we should look if this utility is actually needed in all places its used; I had a very quick peek, but quite possible that it's not.

} else if v != c.expValue {
if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
}
Expand Down
5 changes: 5 additions & 0 deletions cli/command/network/formatter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25

package network

import (
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -115,6 +119,7 @@ func (c *networkContext) Labels() string {
for k, v := range c.n.Labels {
joinLabels = append(joinLabels, k+"="+v)
}
slices.Sort(joinLabels)
return strings.Join(joinLabels, ",")
}

Expand Down
4 changes: 1 addition & 3 deletions cli/command/network/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ func TestNetworkContext(t *testing.T) {
for _, c := range cases {
ctx = c.networkCtx
v := c.call()
if strings.Contains(v, ",") {
test.CompareMultipleValues(t, v, c.expValue)
} else if v != c.expValue {
if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
}
Expand Down
5 changes: 5 additions & 0 deletions cli/command/secret/formatter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25

package secret

import (
"fmt"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -109,6 +113,7 @@ func (c *secretContext) Labels() string {
for k, v := range mapLabels {
joinLabels = append(joinLabels, k+"="+v)
}
slices.Sort(joinLabels)
return strings.Join(joinLabels, ",")
}

Expand Down
Loading