Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 5083311

Browse files
committed
fix some linter issues
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 661244d commit 5083311

File tree

8 files changed

+13
-33
lines changed

8 files changed

+13
-33
lines changed

api/backend/backend.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
package backend
1818

1919
import (
20+
"github.com/docker/compose/v2/pkg/api"
21+
2022
"github.com/docker/compose-ecs/api/secrets"
2123
"github.com/docker/compose-ecs/api/volumes"
22-
"github.com/docker/compose/v2/pkg/api"
2324
)
2425

2526
var instance Service

cli/cmd/secrets.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"os"
2323

2424
"github.com/docker/compose-ecs/api/backend"
25+
"github.com/docker/compose-ecs/api/secrets"
26+
2527
"github.com/docker/compose/v2/cmd/formatter"
2628
"github.com/spf13/cobra"
27-
28-
"github.com/docker/compose-ecs/api/secrets"
2929
)
3030

3131
// SecretCommand manage secrets

cli/cmd/version.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package cmd
1919
import (
2020
"fmt"
2121

22-
"github.com/docker/cli/cli"
2322
"github.com/spf13/cobra"
2423

2524
"github.com/docker/compose-ecs/internal"
@@ -34,10 +33,7 @@ func VersionCommand() *cobra.Command {
3433
Short: "Show the Docker version information",
3534
Args: cobra.MaximumNArgs(0),
3635
RunE: func(cmd *cobra.Command, _ []string) error {
37-
err := runVersion(cmd)
38-
if err != nil {
39-
return cli.StatusError{StatusCode: 1, Status: err.Error()}
40-
}
36+
runVersion()
4137
return nil
4238
},
4339
}
@@ -48,11 +44,10 @@ func VersionCommand() *cobra.Command {
4844
return cmd
4945
}
5046

51-
func runVersion(cmd *cobra.Command) error {
47+
func runVersion() {
5248
if formatOpt == "json" {
5349
fmt.Printf("{\"version\":%q}\n", internal.Version)
5450
} else {
5551
fmt.Printf("Compose ECS %s\n", internal.Version)
5652
}
57-
return nil
5853
}

cli/cmd/volume/list.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ import (
2222
"os"
2323

2424
"github.com/docker/compose-ecs/api/backend"
25-
formatter2 "github.com/docker/compose/v2/cmd/formatter"
25+
"github.com/docker/compose-ecs/api/volumes"
2626

27+
"github.com/docker/compose/v2/cmd/formatter"
2728
"github.com/spf13/cobra"
28-
29-
"github.com/docker/compose-ecs/api/volumes"
3029
)
3130

3231
type listVolumeOpts struct {
@@ -53,14 +52,14 @@ func listVolume() *cobra.Command {
5352
return nil
5453
}
5554
view := viewFromVolumeList(vols)
56-
return formatter2.Print(view, opts.format, os.Stdout, func(w io.Writer) {
55+
return formatter.Print(view, opts.format, os.Stdout, func(w io.Writer) {
5756
for _, vol := range view {
5857
_, _ = fmt.Fprintf(w, "%s\t%s\n", vol.ID, vol.Description)
5958
}
6059
}, "ID", "DESCRIPTION")
6160
},
6261
}
63-
cmd.Flags().StringVar(&opts.format, "format", formatter2.PRETTY, "Format the output. Values: [pretty | json]. (Default: pretty)")
62+
cmd.Flags().StringVar(&opts.format, "format", formatter.PRETTY, "Format the output. Values: [pretty | json]. (Default: pretty)")
6463
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Only display IDs")
6564
return cmd
6665
}

cli/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ import (
2323
"os/signal"
2424
"syscall"
2525

26-
"github.com/docker/compose-ecs/ecs"
27-
compose2 "github.com/docker/compose/v2/cmd/compose"
26+
"github.com/docker/compose/v2/cmd/compose"
2827
"github.com/spf13/cobra"
2928

3029
"github.com/docker/compose-ecs/api/backend"
3130
"github.com/docker/compose-ecs/cli/cmd"
3231
"github.com/docker/compose-ecs/cli/cmd/volume"
33-
// Backend registrations
32+
"github.com/docker/compose-ecs/ecs"
3433
)
3534

3635
func main() {
@@ -63,7 +62,7 @@ func main() {
6362
}
6463
backend.WithBackend(service)
6564

66-
command := compose2.RootCommand(service.ComposeService())
65+
command := compose.RootCommand(service.ComposeService())
6766

6867
for _, c := range command.Commands() {
6968
switch c.Name() {

ecs/e2e/ecs/e2e-ecs_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import (
3232
"gotest.tools/v3/poll"
3333
)
3434

35-
var binDir string
36-
3735
func TestSecrets(t *testing.T) {
3836
startTime := strconv.Itoa(int(time.Now().UnixNano()))
3937
secretName := "secret" + strings.ToLower(t.Name()) + startTime

go.mod

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require (
1616
github.com/hashicorp/go-uuid v1.0.3
1717
github.com/iancoleman/strcase v0.2.0
1818
github.com/joho/godotenv v1.3.0
19-
github.com/labstack/echo v3.3.10+incompatible
2019
github.com/opencontainers/go-digest v1.0.0
2120
github.com/pkg/errors v0.9.1
2221
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b
@@ -80,7 +79,6 @@ require (
8079
github.com/json-iterator/go v1.1.11 // indirect
8180
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
8281
github.com/klauspost/compress v1.11.13 // indirect
83-
github.com/labstack/gommon v0.4.0 // indirect
8482
github.com/mailru/easyjson v0.7.0 // indirect
8583
github.com/mattn/go-colorable v0.1.11 // indirect
8684
github.com/mattn/go-isatty v0.0.14 // indirect
@@ -114,8 +112,6 @@ require (
114112
github.com/theupdateframework/notary v0.6.1 // indirect
115113
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 // indirect
116114
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
117-
github.com/valyala/bytebufferpool v1.0.0 // indirect
118-
github.com/valyala/fasttemplate v1.2.1 // indirect
119115
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
120116
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
121117
github.com/xeipuuv/gojsonschema v1.2.0 // indirect

go.sum

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
761761
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
762762
github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28/go.mod h1:T/T7jsxVqf9k/zYOqbgNAsANsjxTd1Yq3htjDhQ1H0c=
763763
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
764-
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
765-
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
766-
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
767-
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
768764
github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
769765
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
770766
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
@@ -1100,11 +1096,8 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/
11001096
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
11011097
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
11021098
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
1103-
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
11041099
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
11051100
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
1106-
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
1107-
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
11081101
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
11091102
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
11101103
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
@@ -1427,7 +1420,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
14271420
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14281421
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14291422
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1430-
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14311423
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14321424
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14331425
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 commit comments

Comments
 (0)