fmt: fix imports formatting

- run gofmt and goimports
This commit is contained in:
stefanprodan 2020-02-28 12:52:23 +02:00
parent 19faf67523
commit a30f688450
12 changed files with 22 additions and 12 deletions

View File

@ -2,12 +2,13 @@ package main
import ( import (
"flag" "flag"
"log"
"time"
"github.com/weaveworks/flagger/pkg/loadtester" "github.com/weaveworks/flagger/pkg/loadtester"
"github.com/weaveworks/flagger/pkg/logger" "github.com/weaveworks/flagger/pkg/logger"
"github.com/weaveworks/flagger/pkg/signals" "github.com/weaveworks/flagger/pkg/signals"
"go.uber.org/zap" "go.uber.org/zap"
"log"
"time"
) )
var VERSION = "0.12.1" var VERSION = "0.12.1"

View File

@ -2,6 +2,7 @@ package controller
import ( import (
"fmt" "fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"

View File

@ -2,6 +2,7 @@ package controller
import ( import (
"fmt" "fmt"
flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1" flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
clientset "github.com/weaveworks/flagger/pkg/client/clientset/versioned" clientset "github.com/weaveworks/flagger/pkg/client/clientset/versioned"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@ -7,12 +7,13 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"k8s.io/utils/clock"
"net/http" "net/http"
"net/url" "net/url"
"strconv" "strconv"
"time" "time"
"k8s.io/utils/clock"
flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1" flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
) )

View File

@ -2,10 +2,11 @@ package loadtester
import ( import (
"context" "context"
"go.uber.org/zap"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"go.uber.org/zap"
) )
type TaskRunner struct { type TaskRunner struct {

View File

@ -1,9 +1,10 @@
package loadtester package loadtester
import ( import (
"github.com/weaveworks/flagger/pkg/logger"
"testing" "testing"
"time" "time"
"github.com/weaveworks/flagger/pkg/logger"
) )
func TestTaskRunner_Start(t *testing.T) { func TestTaskRunner_Start(t *testing.T) {

View File

@ -179,7 +179,6 @@ func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogge
return return
} }
canaryName := fmt.Sprintf("rollback.%s.%s", canary.Name, canary.Namespace) canaryName := fmt.Sprintf("rollback.%s.%s", canary.Name, canary.Namespace)
gate.close(canaryName) gate.close(canaryName)

View File

@ -3,9 +3,10 @@ package loadtester
import ( import (
"context" "context"
"encoding/hex" "encoding/hex"
"go.uber.org/zap"
"hash/fnv" "hash/fnv"
"sync" "sync"
"go.uber.org/zap"
) )
// Modeling a loadtester task // Modeling a loadtester task

View File

@ -6,12 +6,13 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"go.uber.org/zap"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strconv" "strconv"
"time" "time"
"go.uber.org/zap"
) )
const TaskTypeNGrinder = "ngrinder" const TaskTypeNGrinder = "ngrinder"

View File

@ -3,10 +3,11 @@ package loadtester
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/weaveworks/flagger/pkg/logger"
"gopkg.in/h2non/gock.v1"
"testing" "testing"
"time" "time"
"github.com/weaveworks/flagger/pkg/logger"
"gopkg.in/h2non/gock.v1"
) )
func TestTaskNGrinder(t *testing.T) { func TestTaskNGrinder(t *testing.T) {

View File

@ -4,9 +4,10 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"go.uber.org/zap"
"os/exec" "os/exec"
"strconv" "strconv"
"go.uber.org/zap"
) )
const TaskTypeShell = "cmd" const TaskTypeShell = "cmd"

View File

@ -1,8 +1,9 @@
package observers package observers
import ( import (
flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
"time" "time"
flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
) )
type Interface interface { type Interface interface {