Skip to content

Commit

Permalink
Fix import order
Browse files Browse the repository at this point in the history
All Go files should have exactly three import groups:
- stdlib
- 3rd-party / non-project imports
- project imports (from inside canonical/pebble)
  • Loading branch information
barrettj12 committed Jul 5, 2023
1 parent 8e96c74 commit a4b9c88
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 28 deletions.
1 change: 0 additions & 1 deletion internals/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"unicode/utf8"

"github.com/canonical/go-flags"

"golang.org/x/crypto/ssh/terminal"

"github.com/canonical/pebble/client"
Expand Down
1 change: 0 additions & 1 deletion internals/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"testing"

"golang.org/x/crypto/ssh/terminal"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/cmd"
Expand Down
3 changes: 0 additions & 3 deletions internals/cli/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import (
"os"
"runtime"

// "fmt"
// "net/http"

"gopkg.in/check.v1"

"github.com/canonical/pebble/internals/cli"
Expand Down
4 changes: 2 additions & 2 deletions internals/daemon/api_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"net/http/httptest"
"time"

"github.com/canonical/pebble/internals/overlord/state"

"gopkg.in/check.v1"

"github.com/canonical/pebble/internals/overlord/state"
)

func setupChanges(st *state.State) []string {
Expand Down
3 changes: 2 additions & 1 deletion internals/daemon/api_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import (
"syscall"
"time"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/osutil"
"github.com/canonical/pebble/internals/osutil/sys"
. "gopkg.in/check.v1"
)

var _ = Suite(&filesSuite{})
Expand Down
4 changes: 2 additions & 2 deletions internals/daemon/api_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"strings"
"time"

"github.com/canonical/pebble/internals/overlord/state"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/overlord/state"
)

var servicesLayer = `
Expand Down
4 changes: 2 additions & 2 deletions internals/daemon/api_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"net/url"
"time"

"github.com/canonical/pebble/internals/overlord/state"

"gopkg.in/check.v1"

"github.com/canonical/pebble/internals/overlord/state"
)

func (s *apiSuite) testWarnings(c *check.C, all bool, body io.Reader) (calls string, result interface{}) {
Expand Down
3 changes: 1 addition & 2 deletions internals/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ import (
"syscall"
"time"

"gopkg.in/tomb.v2"

"github.com/gorilla/mux"
"gopkg.in/tomb.v2"

"github.com/canonical/pebble/internals/logger"
"github.com/canonical/pebble/internals/osutil"
Expand Down
2 changes: 0 additions & 2 deletions internals/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ import (
"time"

"github.com/gorilla/mux"

"gopkg.in/check.v1"

// XXX Delete import above and make this file like the other ones.
. "gopkg.in/check.v1"

Expand Down
4 changes: 2 additions & 2 deletions internals/osutil/bootid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
package osutil_test

import (
"github.com/canonical/pebble/internals/osutil"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/osutil"
)

type bootIdSuite struct{}
Expand Down
3 changes: 2 additions & 1 deletion internals/osutil/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package osutil_test

import (
"github.com/canonical/pebble/internals/osutil"
. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/osutil"
)

type envSuite struct{}
Expand Down
4 changes: 2 additions & 2 deletions internals/overlord/patch/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"sort"
"testing"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/overlord/patch"
"github.com/canonical/pebble/internals/overlord/state"

. "gopkg.in/check.v1"
)

func Test(t *testing.T) { TestingT(t) }
Expand Down
4 changes: 2 additions & 2 deletions internals/overlord/servstate/request.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package servstate

import (
"github.com/canonical/pebble/internals/overlord/state"

"fmt"

"github.com/canonical/pebble/internals/overlord/state"
)

// ServiceRequest holds the details required to perform service tasks.
Expand Down
4 changes: 2 additions & 2 deletions internals/overlord/state/change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"time"

"github.com/canonical/pebble/internals/overlord/state"

. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/overlord/state"
)

type changeSuite struct{}
Expand Down
3 changes: 2 additions & 1 deletion internals/servicelog/ringbuffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"io"
"testing"

"github.com/canonical/pebble/internals/servicelog"
. "gopkg.in/check.v1"

"github.com/canonical/pebble/internals/servicelog"
)

type ringBufferSuite struct{}
Expand Down
3 changes: 1 addition & 2 deletions internals/systemd/systemd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ import (

"github.com/canonical/pebble/internals/osutil"
"github.com/canonical/pebble/internals/osutil/squashfs"
"github.com/canonical/pebble/internals/testutil"

"github.com/canonical/pebble/internals/systemd"
"github.com/canonical/pebble/internals/testutil"
)

type testreporter struct {
Expand Down

0 comments on commit a4b9c88

Please sign in to comment.