Skip to content

Commit

Permalink
small code refactor and import organization
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Marin committed Aug 24, 2022
1 parent 8feeb81 commit 477768c
Show file tree
Hide file tree
Showing 38 changed files with 89 additions and 59 deletions.
4 changes: 3 additions & 1 deletion cmd/hostctl/actions/add_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"strings"

"github.com/guumaster/cligger"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

func newAddRemoveDomainsCmd() (*cobra.Command, *cobra.Command) {
Expand Down Expand Up @@ -42,6 +43,7 @@ If the profile already exists it will be added to it.`,
if !quiet {
cligger.Success("Domains '%s' added.\n", strings.Join(args[1:], ", "))
}

return nil
},
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/add_replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"io"
"os"

"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

type addRemoveFn func(h *file.File, p *types.Profile) error
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package actions

import (
"github.com/guumaster/cligger"
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

func newBackupCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/enable_disable.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package actions

import (
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

type enableDisableFn func(h *file.File, profiles []string, only, all bool) error
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"os"
"runtime"

"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/render"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

func commonCheckProfileOnly(_ *cobra.Command, args []string) error {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"sync"
"testing"

"github.com/stretchr/testify/assert"

"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/render"
"github.com/guumaster/hostctl/pkg/types"
"github.com/stretchr/testify/assert"
)

func TestContainsDefault(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion cmd/hostctl/actions/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package actions
import (
"fmt"

"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

func newListCmd() *cobra.Command {
Expand All @@ -31,6 +32,7 @@ The "default" profile is all the content that is not handled by hostctl tool.
h.List(r, &file.ListOptions{
Profiles: profiles,
})

return nil
},
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/hostctl/actions/post_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ func waitSignalOrDuration(d time.Duration) <-chan struct{} {
select {
case <-time.After(d):
done <- struct{}{}

return
case <-sig:
done <- struct{}{}

return
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"strings"

"github.com/guumaster/cligger"
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

func newRemoveCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/remove_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"strings"

"github.com/guumaster/cligger"
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

func newRemoveDomainsCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package actions

import (
"github.com/guumaster/cligger"
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

func newRestoreCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/status.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package actions

import (
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/render"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

func newStatusCmd() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/sync_docker.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package actions

import (
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/docker"
"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

func newSyncDockerCmd(removeCmd *cobra.Command, optsFn getOptionsFn) *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/sync_docker_compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"regexp"
"strings"

"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/docker"
"github.com/guumaster/hostctl/pkg/file"
"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/cobra"
)

type composeInfo struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/sync_docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"testing"

"github.com/docker/docker/client"
"github.com/guumaster/hostctl/pkg/docker"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"

"github.com/guumaster/hostctl/pkg/docker"
)

func testGetOptions(t *testing.T, cli *client.Client) getOptionsFn {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hostctl/actions/toggle.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package actions

import (
"github.com/guumaster/hostctl/pkg/file"
"github.com/spf13/cobra"

"github.com/guumaster/hostctl/pkg/file"
)

func newToggleCmd() *cobra.Command {
Expand Down
1 change: 1 addition & 0 deletions cmd/hostctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"github.com/guumaster/cligger"

"github.com/guumaster/hostctl/cmd/hostctl/actions"
)

Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ require (
github.com/docker/go-units v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/guumaster/logsymbols v0.3.1 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.3.4 // indirect
github.com/rivo/uniseg v0.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20220809012201-f428fae20770 // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/text v0.3.4 // indirect
gopkg.in/gookit/color.v1 v1.1.6 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gotest.tools/v3 v3.3.0 // indirect
)
26 changes: 8 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand All @@ -154,12 +153,10 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI=
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
Expand All @@ -175,10 +172,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.3.4 h1:3Z3Eu6FGHZWSfNKJTOUiPatWwfc7DzJRU04jFUqJODw=
github.com/rivo/uniseg v0.3.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down Expand Up @@ -278,9 +273,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220809012201-f428fae20770 h1:dIi4qVdvjZEjiMDv7vhokAZNGnz3kepwuXqFKYDdDMs=
golang.org/x/net v0.0.0-20220809012201-f428fae20770/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -338,19 +332,16 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 h1:v1W7bwXHsnLLloWYTVEdvGvA7BHMeBYsPcF0GLDxIRs=
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
Expand Down Expand Up @@ -506,9 +497,8 @@ gopkg.in/gookit/color.v1 v1.1.6/go.mod h1:IcEkFGaveVShJ+j8ew+jwe9epHyGpJ9IrptHmW
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo=
gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A=
Expand Down
2 changes: 2 additions & 0 deletions pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
dtypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"

"github.com/guumaster/hostctl/pkg/types"
)

Expand Down Expand Up @@ -71,6 +72,7 @@ func GetNetworkID(ctx context.Context, cli *client.Client, network string) (stri
for _, net := range nets {
if net.Name == network || net.ID == network {
networkID = net.ID

break
}
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (

dtypes "github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/guumaster/hostctl/pkg/types"
"github.com/stretchr/testify/assert"

"github.com/guumaster/hostctl/pkg/types"
)

func TestNew(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/file/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"

"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/types"
"github.com/stretchr/testify/assert"
)

func TestFile_AddProfile(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/file/enable_disable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package file
import (
"testing"

"github.com/guumaster/hostctl/pkg/types"
"github.com/stretchr/testify/assert"

"github.com/guumaster/hostctl/pkg/types"
)

func TestFile_EnableDisable(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"os"
"sync"

"github.com/spf13/afero"

"github.com/guumaster/hostctl/pkg/parser"
"github.com/guumaster/hostctl/pkg/types"
"github.com/spf13/afero"
)

// File container to handle a hosts file.
Expand Down
Loading

0 comments on commit 477768c

Please sign in to comment.