Skip to content

Commit

Permalink
fix import style (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou authored and yaron2 committed Dec 4, 2019
1 parent 8247b02 commit 72ada12
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 82 deletions.
5 changes: 2 additions & 3 deletions cmd/operator/main.go
Expand Up @@ -9,15 +9,14 @@ import (
"flag"
"time"

scheme "github.com/dapr/dapr/pkg/client/clientset/versioned"
"k8s.io/klog"

log "github.com/Sirupsen/logrus"
scheme "github.com/dapr/dapr/pkg/client/clientset/versioned"
k8s "github.com/dapr/dapr/pkg/kubernetes"
"github.com/dapr/dapr/pkg/operator"
"github.com/dapr/dapr/pkg/signals"
"github.com/dapr/dapr/pkg/version"
"github.com/dapr/dapr/utils"
"k8s.io/klog"
)

var (
Expand Down
9 changes: 3 additions & 6 deletions pkg/actors/actors.go
Expand Up @@ -15,17 +15,14 @@ import (
"sync"
"time"

"github.com/mitchellh/mapstructure"

"github.com/dapr/dapr/pkg/channel/http"

"github.com/golang/protobuf/ptypes/any"

log "github.com/Sirupsen/logrus"
"github.com/dapr/components-contrib/state"
"github.com/dapr/dapr/pkg/channel"
"github.com/dapr/dapr/pkg/channel/http"
"github.com/dapr/dapr/pkg/placement"
daprinternal_pb "github.com/dapr/dapr/pkg/proto/daprinternal"
"github.com/golang/protobuf/ptypes/any"
"github.com/mitchellh/mapstructure"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
Expand Down
7 changes: 3 additions & 4 deletions pkg/actors/actors_test.go
Expand Up @@ -14,13 +14,12 @@ import (
"time"

"github.com/dapr/components-contrib/state"
jsoniter "github.com/json-iterator/go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/dapr/dapr/pkg/channel"
"github.com/dapr/dapr/pkg/channel/http"
channelt "github.com/dapr/dapr/pkg/channel/testing"
jsoniter "github.com/json-iterator/go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions pkg/channel/grpc/grpc_channel.go
Expand Up @@ -12,11 +12,10 @@ import (
"strings"
"time"

"github.com/golang/protobuf/ptypes/any"
"google.golang.org/grpc"

"github.com/dapr/dapr/pkg/channel"
daprclient_pb "github.com/dapr/dapr/pkg/proto/daprclient"
"github.com/golang/protobuf/ptypes/any"
"google.golang.org/grpc"
)

// Channel is a concrete AppChannel implementation for interacting with gRPC based user code
Expand Down
3 changes: 1 addition & 2 deletions pkg/channel/http/http_channel_test.go
Expand Up @@ -14,10 +14,9 @@ import (
"sync"
"testing"

"github.com/valyala/fasthttp"

"github.com/dapr/dapr/pkg/channel"
"github.com/stretchr/testify/assert"
"github.com/valyala/fasthttp"
)

type testConcurrencyHandler struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/discovery/mdns.go
Expand Up @@ -13,9 +13,8 @@ import (
"syscall"
"time"

"github.com/grandcat/zeroconf"

log "github.com/Sirupsen/logrus"
"github.com/grandcat/zeroconf"
)

// RegisterMDNS uses mdns to publish an entry of the service to a local network
Expand Down
12 changes: 4 additions & 8 deletions pkg/grpc/api.go
Expand Up @@ -12,23 +12,19 @@ import (
"time"

"github.com/dapr/components-contrib/bindings"

"github.com/google/uuid"

"github.com/dapr/dapr/pkg/actors"

"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/empty"

"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/components-contrib/state"
"github.com/dapr/dapr/pkg/actors"
components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
"github.com/dapr/dapr/pkg/channel"
"github.com/dapr/dapr/pkg/components"
"github.com/dapr/dapr/pkg/messaging"
dapr_pb "github.com/dapr/dapr/pkg/proto/dapr"
daprinternal_pb "github.com/dapr/dapr/pkg/proto/daprinternal"
"github.com/golang/protobuf/ptypes/any"
durpb "github.com/golang/protobuf/ptypes/duration"
"github.com/golang/protobuf/ptypes/empty"
"github.com/google/uuid"
jsoniter "github.com/json-iterator/go"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/grpc/grpc.go
Expand Up @@ -9,10 +9,9 @@ import (
"fmt"
"sync"

"google.golang.org/grpc"

"github.com/dapr/dapr/pkg/channel"
grpc_channel "github.com/dapr/dapr/pkg/channel/grpc"
"google.golang.org/grpc"
)

// Manager is a wrapper around gRPC connection pooling
Expand Down
6 changes: 2 additions & 4 deletions pkg/http/api.go
Expand Up @@ -13,15 +13,13 @@ import (

"github.com/dapr/components-contrib/bindings"
"github.com/dapr/components-contrib/pubsub"
"github.com/google/uuid"

jsoniter "github.com/json-iterator/go"

"github.com/dapr/components-contrib/state"
"github.com/dapr/dapr/pkg/actors"
"github.com/dapr/dapr/pkg/channel"
"github.com/dapr/dapr/pkg/channel/http"
"github.com/dapr/dapr/pkg/messaging"
"github.com/google/uuid"
jsoniter "github.com/json-iterator/go"
routing "github.com/qiangxue/fasthttp-routing"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/http/server.go
Expand Up @@ -9,14 +9,13 @@ import (
"fmt"
"strings"

"github.com/valyala/fasthttp/pprofhandler"

cors "github.com/AdhityaRamadhanus/fasthttpcors"
log "github.com/Sirupsen/logrus"
"github.com/dapr/dapr/pkg/config"
diag "github.com/dapr/dapr/pkg/diagnostics"
routing "github.com/qiangxue/fasthttp-routing"
"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/pprofhandler"
)

// Server is an interface for the Dapr HTTP server
Expand Down
6 changes: 2 additions & 4 deletions pkg/kubernetes/kubernetes_test.go
Expand Up @@ -8,15 +8,13 @@ package kubernetes
import (
"testing"

versioned "github.com/dapr/dapr/pkg/client/clientset/versioned"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/stretchr/testify/assert"

versioned "github.com/dapr/dapr/pkg/client/clientset/versioned"
fake "k8s.io/client-go/kubernetes/fake"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/messaging/direct_messaging.go
Expand Up @@ -10,12 +10,11 @@ import (
"errors"
"time"

"github.com/golang/protobuf/ptypes/any"

"github.com/dapr/components-contrib/servicediscovery"
"github.com/dapr/dapr/pkg/channel"
"github.com/dapr/dapr/pkg/modes"
daprinternal_pb "github.com/dapr/dapr/pkg/proto/daprinternal"
"github.com/golang/protobuf/ptypes/any"
"google.golang.org/grpc"
)

Expand Down
11 changes: 4 additions & 7 deletions pkg/operator/handlers/components.go
Expand Up @@ -5,17 +5,14 @@ import (
"fmt"
"time"

"google.golang.org/grpc"

"k8s.io/apimachinery/pkg/labels"

log "github.com/Sirupsen/logrus"
components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
pb "github.com/dapr/dapr/pkg/proto/daprinternal"
"google.golang.org/grpc"
corev1 "k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"

components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
pb "github.com/dapr/dapr/pkg/proto/daprinternal"
)

// ComponentsHandler handles the lifetime management of Component CRDs
Expand Down
3 changes: 1 addition & 2 deletions pkg/operator/handlers/dapr_handler.go
Expand Up @@ -5,13 +5,12 @@ import (
"strings"
"sync"

"k8s.io/apimachinery/pkg/util/intstr"

log "github.com/Sirupsen/logrus"
"github.com/dapr/dapr/pkg/kubernetes"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pkg/operator/handlers/dapr_handler_test.go
Expand Up @@ -3,10 +3,9 @@ package handlers
import (
"testing"

"github.com/stretchr/testify/assert"

versioned "github.com/dapr/dapr/pkg/client/clientset/versioned"
"github.com/dapr/dapr/pkg/kubernetes"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
28 changes: 10 additions & 18 deletions pkg/runtime/runtime.go
Expand Up @@ -16,42 +16,34 @@ import (
"sync"
"time"

"github.com/golang/protobuf/ptypes/empty"

"github.com/golang/protobuf/ptypes/any"

log "github.com/Sirupsen/logrus"
"github.com/dapr/components-contrib/bindings"
"github.com/dapr/components-contrib/exporters"

"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/components-contrib/secretstores"
"github.com/dapr/components-contrib/servicediscovery"
"github.com/dapr/components-contrib/state"

"github.com/dapr/dapr/pkg/actors"
components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
"github.com/dapr/dapr/pkg/channel"
http_channel "github.com/dapr/dapr/pkg/channel/http"
"github.com/dapr/dapr/pkg/components"
bindings_loader "github.com/dapr/dapr/pkg/components/bindings"
exporter_loader "github.com/dapr/dapr/pkg/components/exporters"
pubsub_loader "github.com/dapr/dapr/pkg/components/pubsub"
secretstores_loader "github.com/dapr/dapr/pkg/components/secretstores"
servicediscovery_loader "github.com/dapr/dapr/pkg/components/servicediscovery"
state_loader "github.com/dapr/dapr/pkg/components/state"
"github.com/dapr/dapr/pkg/config"
"github.com/dapr/dapr/pkg/discovery"
"github.com/dapr/dapr/pkg/grpc"
"github.com/dapr/dapr/pkg/http"
"github.com/dapr/dapr/pkg/messaging"
jsoniter "github.com/json-iterator/go"

"github.com/dapr/dapr/pkg/channel"
http_channel "github.com/dapr/dapr/pkg/channel/http"

"github.com/dapr/dapr/pkg/config"
"github.com/dapr/dapr/pkg/grpc"

"github.com/dapr/dapr/pkg/components"
"github.com/dapr/dapr/pkg/modes"

log "github.com/Sirupsen/logrus"
components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
daprclient_pb "github.com/dapr/dapr/pkg/proto/daprclient"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/empty"
jsoniter "github.com/json-iterator/go"
)

const (
Expand Down
8 changes: 3 additions & 5 deletions pkg/runtime/runtime_test.go
Expand Up @@ -10,21 +10,19 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/mock"

"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/components-contrib/secretstores"
components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
"github.com/dapr/dapr/pkg/channel"
http_channel "github.com/dapr/dapr/pkg/channel/http"
channelt "github.com/dapr/dapr/pkg/channel/testing"
pubsub_loader "github.com/dapr/dapr/pkg/components/pubsub"
secretstores_loader "github.com/dapr/dapr/pkg/components/secretstores"
"github.com/dapr/dapr/pkg/config"
"github.com/dapr/dapr/pkg/modes"
daprt "github.com/dapr/dapr/pkg/testing"

components_v1alpha1 "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
"github.com/dapr/dapr/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
7 changes: 3 additions & 4 deletions tests/e2e/utils/helpers.go
Expand Up @@ -20,11 +20,10 @@ import (
guuid "github.com/google/uuid"
)


// SimpleKeyValue can be used to simplify code, providing simple key-value pairs.
type SimpleKeyValue struct {
Key interface{}
Value interface {}
Key interface{}
Value interface{}
}

// GenerateRandomStringKeys generates random string keys (values are nil).
Expand All @@ -47,7 +46,7 @@ func GenerateRandomStringValues(keyValues []SimpleKeyValue) []SimpleKeyValue {
output := make([]SimpleKeyValue, 0, len(keyValues))
for i, keyValue := range keyValues {
key := keyValue.Key
value := fmt.Sprintf("Value for entry #%d with key %v.", i + 1, key)
value := fmt.Sprintf("Value for entry #%d with key %v.", i+1, key)
output = append(output, SimpleKeyValue{key, value})
}

Expand Down
3 changes: 1 addition & 2 deletions utils/utils.go
Expand Up @@ -9,9 +9,8 @@ import (
"flag"
"path/filepath"

"k8s.io/client-go/rest"

"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
)
Expand Down

0 comments on commit 72ada12

Please sign in to comment.