Skip to content

Commit

Permalink
Format imports based on package location
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed May 21, 2024
1 parent f0a9513 commit 79c063b
Show file tree
Hide file tree
Showing 37 changed files with 46 additions and 40 deletions.
2 changes: 1 addition & 1 deletion api/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/gorilla/websocket"
"github.com/juju/clock"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/names/v5"
"github.com/juju/utils/v4"
"github.com/juju/utils/v4/parallel"
Expand All @@ -35,6 +34,7 @@ import (
"github.com/juju/juju/core/facades"
coremacaroon "github.com/juju/juju/core/macaroon"
"github.com/juju/juju/core/network"
jujuhttp "github.com/juju/juju/internal/http"
internallogger "github.com/juju/juju/internal/logger"
jujuproxy "github.com/juju/juju/internal/proxy"
proxy "github.com/juju/juju/internal/proxy/config"
Expand Down
1 change: 1 addition & 0 deletions api/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (*ImportSuite) TestImports(c *gc.C) {
"domain/secretbackend/errors",
"environs/envcontext",
"internal/feature",
"internal/http",
"internal/logger",
"internal/proxy",
"internal/proxy/config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"github.com/juju/charm/v13"
"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/juju/internal/http"
"github.com/juju/names/v5"

apiservererrors "github.com/juju/juju/apiserver/errors"
corelogger "github.com/juju/juju/core/logger"
"github.com/juju/juju/internal/charm/services"
"github.com/juju/juju/internal/http"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/state/watcher"
)
Expand Down
2 changes: 1 addition & 1 deletion apiserver/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/gorilla/websocket"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/loggo/v2"
"github.com/juju/names/v5"
"github.com/juju/pubsub/v2"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/juju/juju/core/permission"
"github.com/juju/juju/domain/access/service"
"github.com/juju/juju/internal/auth"
jujuhttp "github.com/juju/juju/internal/http"
jujutesting "github.com/juju/juju/juju/testing"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/state"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"strings"

"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
"github.com/juju/testing/httptesting"
"go.uber.org/mock/gomock"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/juju/juju/domain/access/service"
"github.com/juju/juju/environs"
"github.com/juju/juju/internal/auth"
jujuhttp "github.com/juju/juju/internal/http"
jujutesting "github.com/juju/juju/juju/testing"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/state/stateenvirons"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/gorilla/websocket"
jujuerrors "github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/loggo/v2"
"github.com/juju/names/v5"
jc "github.com/juju/testing/checkers"
Expand All @@ -27,6 +26,7 @@ import (
apitesting "github.com/juju/juju/apiserver/testing"
"github.com/juju/juju/core/network"
"github.com/juju/juju/core/permission"
jujuhttp "github.com/juju/juju/internal/http"
jujutesting "github.com/juju/juju/juju/testing"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/state"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/testing/fakeapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (

"github.com/bmizerany/pat"
"github.com/gorilla/websocket"
jujuhttp "github.com/juju/juju/internal/http"

apiservererrors "github.com/juju/juju/apiserver/errors"
"github.com/juju/juju/apiserver/observer"
"github.com/juju/juju/apiserver/observer/fakeobserver"
apiwebsocket "github.com/juju/juju/apiserver/websocket"
"github.com/juju/juju/core/trace"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/rpcreflect"
"github.com/juju/juju/rpc"
"github.com/juju/juju/rpc/jsoncodec"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/testing/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"io"
"net/http"

jujuhttp "github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
"github.com/juju/testing/httptesting"
gc "gopkg.in/check.v1"

jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/rpc/params"
jujuversion "github.com/juju/juju/version"
)
Expand Down
2 changes: 1 addition & 1 deletion apiserver/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

"github.com/im7mortal/kmutex"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/version/v2"

"github.com/juju/juju/apiserver/common"
Expand All @@ -25,6 +24,7 @@ import (
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/simplestreams"
envtools "github.com/juju/juju/environs/tools"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/tools"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/state"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/tools_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/names/v5"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/juju/juju/core/permission"
"github.com/juju/juju/domain/access/service"
"github.com/juju/juju/internal/auth"
jujuhttp "github.com/juju/juju/internal/http"
jujutesting "github.com/juju/juju/juju/testing"
"github.com/juju/juju/rpc/params"
"github.com/juju/juju/testing/factory"
Expand Down
1 change: 1 addition & 0 deletions cmd/containeragent/initialize/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (*importSuite) TestImports(c *gc.C) {
"internal/charmhub/path",
"internal/charmhub/transport",
"internal/feature",
"internal/http",
"internal/logger",
"internal/mongo",
"internal/network",
Expand Down
2 changes: 1 addition & 1 deletion cmd/juju/controller/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/juju/collections/set"
"github.com/juju/errors"
"github.com/juju/gnuflag"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/names/v5"
"golang.org/x/crypto/nacl/secretbox"
"golang.org/x/crypto/ssh/terminal"
Expand All @@ -39,6 +38,7 @@ import (
"github.com/juju/juju/cmd/modelcmd"
corelogger "github.com/juju/juju/core/logger"
"github.com/juju/juju/core/permission"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/proxy/factory"
"github.com/juju/juju/jujuclient"
"github.com/juju/juju/rpc/params"
Expand Down
2 changes: 1 addition & 1 deletion environs/simplestreams/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (

"github.com/juju/clock"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/retry"
"github.com/juju/utils/v4"

corelogger "github.com/juju/juju/core/logger"
jujuhttp "github.com/juju/juju/internal/http"
)

// A DataSource retrieves simplestreams metadata.
Expand Down
2 changes: 1 addition & 1 deletion environs/simplestreams/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"net/http"
"strings"

jujuhttp "github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/juju/environs/simplestreams"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/testing"
)

Expand Down
2 changes: 1 addition & 1 deletion environs/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"path/filepath"

"github.com/juju/errors"
"github.com/juju/juju/internal/http"
"github.com/juju/utils/v4"
"github.com/juju/version/v2"

"github.com/juju/juju/environs/filestorage"
"github.com/juju/juju/environs/simplestreams"
"github.com/juju/juju/environs/storage"
envtools "github.com/juju/juju/environs/tools"
"github.com/juju/juju/internal/http"
internallogger "github.com/juju/juju/internal/logger"
coretools "github.com/juju/juju/internal/tools"
"github.com/juju/juju/juju/keys"
Expand Down
2 changes: 1 addition & 1 deletion environs/sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"path/filepath"

"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
jujutesting "github.com/juju/testing"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils/v4/tar"
Expand All @@ -35,6 +34,7 @@ import (
envtesting "github.com/juju/juju/environs/testing"
envtools "github.com/juju/juju/environs/tools"
toolstesting "github.com/juju/juju/environs/tools/testing"
jujuhttp "github.com/juju/juju/internal/http"
coretools "github.com/juju/juju/internal/tools"
"github.com/juju/juju/juju/names"
coretesting "github.com/juju/juju/testing"
Expand Down
2 changes: 1 addition & 1 deletion environs/testing/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"strings"

"github.com/juju/collections/set"
"github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
"github.com/juju/version/v2"
gc "gopkg.in/check.v1"
Expand All @@ -27,6 +26,7 @@ import (
sstesting "github.com/juju/juju/environs/simplestreams/testing"
"github.com/juju/juju/environs/storage"
envtools "github.com/juju/juju/environs/tools"
"github.com/juju/juju/internal/http"
coretools "github.com/juju/juju/internal/tools"
"github.com/juju/juju/juju/names"
coretesting "github.com/juju/juju/testing"
Expand Down
2 changes: 1 addition & 1 deletion internal/charmhub/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (

"github.com/juju/clock"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/retry"
"gopkg.in/httprequest.v1"

corelogger "github.com/juju/juju/core/logger"
"github.com/juju/juju/internal/charmhub/path"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/version"
)

Expand Down
3 changes: 2 additions & 1 deletion internal/charmhub/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import (
"time"

"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
"go.uber.org/mock/gomock"
gc "gopkg.in/check.v1"

jujuhttp "github.com/juju/juju/internal/http"
)

type APIRequesterSuite struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/http/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (

"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/juju/core/logger"
"github.com/juju/loggo/v2"
"github.com/juju/retry"
"golang.org/x/net/http/httpproxy"

"github.com/juju/juju/core/logger"
)

// FileProtocolMiddleware registers support for file:// URLs on the given transport.
Expand Down
3 changes: 2 additions & 1 deletion internal/mongo/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
"time"

"github.com/juju/errors"
"github.com/juju/juju/internal/http"
"github.com/juju/mgo/v3"
"github.com/juju/names/v5"
"github.com/juju/utils/v4/cert"

"github.com/juju/juju/internal/http"
)

// SocketTimeout should be long enough that even a slow mongo server
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/ec2/environ.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/juju/clock"
"github.com/juju/collections/set"
"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/names/v5"
"github.com/juju/retry"
"github.com/juju/version/v2"
Expand All @@ -49,6 +48,7 @@ import (
"github.com/juju/juju/environs/tags"
"github.com/juju/juju/internal/cloudconfig/instancecfg"
"github.com/juju/juju/internal/cloudconfig/providerinit"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/provider/common"
"github.com/juju/juju/internal/storage"
)
Expand Down
5 changes: 2 additions & 3 deletions internal/provider/gce/environ.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
package gce

import (
"context"
stdcontext "context"
"strings"
"sync"
"time"

"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"google.golang.org/api/compute/v1"

jujucloud "github.com/juju/juju/cloud"
Expand All @@ -25,6 +23,7 @@ import (
"github.com/juju/juju/environs/envcontext"
"github.com/juju/juju/environs/instances"
"github.com/juju/juju/environs/simplestreams"
jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/provider/common"
"github.com/juju/juju/internal/provider/gce/google"
)
Expand Down Expand Up @@ -200,7 +199,7 @@ func (env *environ) Region() (simplestreams.CloudSpec, error) {
}

// SetConfig updates the env's configuration.
func (env *environ) SetConfig(ctx context.Context, cfg *config.Config) error {
func (env *environ) SetConfig(ctx stdcontext.Context, cfg *config.Config) error {
env.lock.Lock()
defer env.lock.Unlock()

Expand Down
3 changes: 2 additions & 1 deletion internal/provider/gce/google/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"context"

"github.com/juju/errors"
jujuhttp "github.com/juju/juju/internal/http"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
"google.golang.org/api/compute/v1"
"google.golang.org/api/option"
transporthttp "google.golang.org/api/transport/http"

jujuhttp "github.com/juju/juju/internal/http"
)

var scopes = []string{
Expand Down
3 changes: 2 additions & 1 deletion internal/provider/gce/google/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ package google
import (
"context"

jujuhttp "github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

jujuhttp "github.com/juju/juju/internal/http"
)

type authSuite struct {
Expand Down
1 change: 1 addition & 0 deletions internal/provider/gce/google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/mail"

"github.com/juju/errors"

jujuhttp "github.com/juju/juju/internal/http"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/gce/google/config_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
package google_test

import (
jujuhttp "github.com/juju/juju/internal/http"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

jujuhttp "github.com/juju/juju/internal/http"
"github.com/juju/juju/internal/provider/gce/google"
)

Expand Down
Loading

0 comments on commit 79c063b

Please sign in to comment.