Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
fix some linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Apr 21, 2023
1 parent 661244d commit f8b39f9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 29 deletions.
3 changes: 2 additions & 1 deletion api/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package backend

import (
"github.com/docker/compose/v2/pkg/api"

"github.com/docker/compose-ecs/api/secrets"
"github.com/docker/compose-ecs/api/volumes"
"github.com/docker/compose/v2/pkg/api"
)

var instance Service
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"os"

"github.com/docker/compose-ecs/api/backend"
"github.com/docker/compose-ecs/api/secrets"
"github.com/docker/compose/v2/cmd/formatter"
"github.com/spf13/cobra"

"github.com/docker/compose-ecs/api/secrets"
"github.com/spf13/cobra"
)

// SecretCommand manage secrets
Expand Down
9 changes: 2 additions & 7 deletions cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package cmd
import (
"fmt"

"github.com/docker/cli/cli"
"github.com/spf13/cobra"

"github.com/docker/compose-ecs/internal"
Expand All @@ -34,10 +33,7 @@ func VersionCommand() *cobra.Command {
Short: "Show the Docker version information",
Args: cobra.MaximumNArgs(0),
RunE: func(cmd *cobra.Command, _ []string) error {
err := runVersion(cmd)
if err != nil {
return cli.StatusError{StatusCode: 1, Status: err.Error()}
}
runVersion()
return nil
},
}
Expand All @@ -48,11 +44,10 @@ func VersionCommand() *cobra.Command {
return cmd
}

func runVersion(cmd *cobra.Command) error {
func runVersion() {
if formatOpt == "json" {
fmt.Printf("{\"version\":%q}\n", internal.Version)
} else {
fmt.Printf("Compose ECS %s\n", internal.Version)
}
return nil
}
9 changes: 4 additions & 5 deletions cli/cmd/volume/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ import (
"os"

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

"github.com/docker/compose/v2/cmd/formatter"
"github.com/spf13/cobra"

"github.com/docker/compose-ecs/api/volumes"
)

type listVolumeOpts struct {
Expand All @@ -53,14 +52,14 @@ func listVolume() *cobra.Command {
return nil
}
view := viewFromVolumeList(vols)
return formatter2.Print(view, opts.format, os.Stdout, func(w io.Writer) {
return formatter.Print(view, opts.format, os.Stdout, func(w io.Writer) {
for _, vol := range view {
_, _ = fmt.Fprintf(w, "%s\t%s\n", vol.ID, vol.Description)
}
}, "ID", "DESCRIPTION")
},
}
cmd.Flags().StringVar(&opts.format, "format", formatter2.PRETTY, "Format the output. Values: [pretty | json]. (Default: pretty)")
cmd.Flags().StringVar(&opts.format, "format", formatter.PRETTY, "Format the output. Values: [pretty | json]. (Default: pretty)")
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Only display IDs")
return cmd
}
Expand Down
2 changes: 0 additions & 2 deletions ecs/e2e/ecs/e2e-ecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import (
"gotest.tools/v3/poll"
)

var binDir string

func TestSecrets(t *testing.T) {
startTime := strconv.Itoa(int(time.Now().UnixNano()))
secretName := "secret" + strings.ToLower(t.Name()) + startTime
Expand Down
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/hashicorp/go-uuid v1.0.3
github.com/iancoleman/strcase v0.2.0
github.com/joho/godotenv v1.3.0
github.com/labstack/echo v3.3.10+incompatible
github.com/opencontainers/go-digest v1.0.0
github.com/pkg/errors v0.9.1
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b
Expand Down Expand Up @@ -80,7 +79,6 @@ require (
github.com/json-iterator/go v1.1.11 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.11.13 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
Expand Down Expand Up @@ -114,8 +112,6 @@ require (
github.com/theupdateframework/notary v0.6.1 // indirect
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 // indirect
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
Expand Down
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28/go.mod h1:T/T7jsxVqf9k/zYOqbgNAsANsjxTd1Yq3htjDhQ1H0c=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
Expand Down Expand Up @@ -1100,11 +1096,8 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
Expand Down Expand Up @@ -1427,7 +1420,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down

0 comments on commit f8b39f9

Please sign in to comment.