From bb001586a416b9c660c7d19065c07bd1f17fd970 Mon Sep 17 00:00:00 2001 From: Yun Long Date: Sun, 10 Mar 2024 11:41:45 +0800 Subject: [PATCH] Gofmt all source files Signed-off-by: Yun Long --- pkg/api/customdata.go | 2 +- pkg/api/logs.go | 2 +- pkg/filters/builder/builder.go | 2 +- pkg/filters/builder/requestbuilder_test.go | 2 +- pkg/filters/connectcontrol/connectcontrol_test.go | 2 +- pkg/filters/headertojson/headertojson.go | 2 +- pkg/filters/headertojson/headertojson_test.go | 2 +- pkg/filters/mqttclientauth/mqttauth.go | 2 +- pkg/filters/mqttclientauth/mqttauth_test.go | 2 +- pkg/filters/proxies/httpproxy/healthcheck.go | 2 +- pkg/filters/proxies/httpproxy/healthcheck_test.go | 2 +- pkg/filters/topicmapper/topicmapper_test.go | 2 +- pkg/object/autocertmanager/autocertmanager_test.go | 2 +- pkg/object/autocertmanager/domain.go | 2 +- pkg/object/grpcserver/mux.go | 2 +- pkg/object/httpserver/mux.go | 2 +- pkg/object/meshcontroller/api/api_customresource.go | 2 +- pkg/object/mqttproxy/broker.go | 2 +- pkg/object/mqttproxy/client.go | 2 +- pkg/object/mqttproxy/mock_test.go | 2 +- pkg/object/mqttproxy/mqtt_test.go | 4 ++-- pkg/object/mqttproxy/session.go | 2 +- pkg/object/mqttproxy/session_manager.go | 2 +- pkg/object/serviceregistry/watcher.go | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pkg/api/customdata.go b/pkg/api/customdata.go index 26ac58b43b..6e8f8e1476 100644 --- a/pkg/api/customdata.go +++ b/pkg/api/customdata.go @@ -21,9 +21,9 @@ import ( "fmt" "net/http" - "github.com/go-chi/chi/v5" "github.com/easegress-io/easegress/v2/pkg/cluster/customdata" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + "github.com/go-chi/chi/v5" ) const ( diff --git a/pkg/api/logs.go b/pkg/api/logs.go index d25c63274a..23e707ad24 100644 --- a/pkg/api/logs.go +++ b/pkg/api/logs.go @@ -26,9 +26,9 @@ import ( "strconv" "strings" + "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/fsnotify/fsnotify" "github.com/go-chi/chi/v5" - "github.com/easegress-io/easegress/v2/pkg/logger" "go.uber.org/zap" ) diff --git a/pkg/filters/builder/builder.go b/pkg/filters/builder/builder.go index 62841f63ad..36794d7b43 100644 --- a/pkg/filters/builder/builder.go +++ b/pkg/filters/builder/builder.go @@ -22,9 +22,9 @@ import ( "bytes" "text/template" - sprig "github.com/go-task/slim-sprig" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + sprig "github.com/go-task/slim-sprig" ) const ( diff --git a/pkg/filters/builder/requestbuilder_test.go b/pkg/filters/builder/requestbuilder_test.go index 55ed03bcd8..a18630b489 100644 --- a/pkg/filters/builder/requestbuilder_test.go +++ b/pkg/filters/builder/requestbuilder_test.go @@ -23,11 +23,11 @@ import ( "strings" "testing" - sprig "github.com/go-task/slim-sprig" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" "github.com/easegress-io/easegress/v2/pkg/protocols/httpprot" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + sprig "github.com/go-task/slim-sprig" "github.com/stretchr/testify/assert" ) diff --git a/pkg/filters/connectcontrol/connectcontrol_test.go b/pkg/filters/connectcontrol/connectcontrol_test.go index 1bb0649ebc..414bcfbae2 100644 --- a/pkg/filters/connectcontrol/connectcontrol_test.go +++ b/pkg/filters/connectcontrol/connectcontrol_test.go @@ -20,11 +20,11 @@ package connectcontrol import ( "testing" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/stretchr/testify/assert" ) diff --git a/pkg/filters/headertojson/headertojson.go b/pkg/filters/headertojson/headertojson.go index c23d7ba4d9..ce88ee9ced 100644 --- a/pkg/filters/headertojson/headertojson.go +++ b/pkg/filters/headertojson/headertojson.go @@ -23,9 +23,9 @@ import ( "io" "net/http" - json "github.com/goccy/go-json" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" + json "github.com/goccy/go-json" ) const ( diff --git a/pkg/filters/headertojson/headertojson_test.go b/pkg/filters/headertojson/headertojson_test.go index 52c2a47ad4..2114f3c8b0 100644 --- a/pkg/filters/headertojson/headertojson_test.go +++ b/pkg/filters/headertojson/headertojson_test.go @@ -24,11 +24,11 @@ import ( "strings" "testing" - json "github.com/goccy/go-json" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/httpprot" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" ) diff --git a/pkg/filters/mqttclientauth/mqttauth.go b/pkg/filters/mqttclientauth/mqttauth.go index 6e8a18910c..0571a366b2 100644 --- a/pkg/filters/mqttclientauth/mqttauth.go +++ b/pkg/filters/mqttclientauth/mqttauth.go @@ -22,11 +22,11 @@ import ( "crypto/sha256" "encoding/hex" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" ) const ( diff --git a/pkg/filters/mqttclientauth/mqttauth_test.go b/pkg/filters/mqttclientauth/mqttauth_test.go index e86cc47448..cccd7f0fbf 100644 --- a/pkg/filters/mqttclientauth/mqttauth_test.go +++ b/pkg/filters/mqttclientauth/mqttauth_test.go @@ -22,10 +22,10 @@ import ( "sync" "testing" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/stretchr/testify/assert" ) diff --git a/pkg/filters/proxies/httpproxy/healthcheck.go b/pkg/filters/proxies/httpproxy/healthcheck.go index 4a22635c22..3616195459 100644 --- a/pkg/filters/proxies/httpproxy/healthcheck.go +++ b/pkg/filters/proxies/httpproxy/healthcheck.go @@ -27,9 +27,9 @@ import ( "regexp" "strings" - "github.com/gorilla/websocket" "github.com/easegress-io/easegress/v2/pkg/filters/proxies" "github.com/easegress-io/easegress/v2/pkg/logger" + "github.com/gorilla/websocket" ) const ( diff --git a/pkg/filters/proxies/httpproxy/healthcheck_test.go b/pkg/filters/proxies/httpproxy/healthcheck_test.go index 9a860b83c4..9da3463c43 100644 --- a/pkg/filters/proxies/httpproxy/healthcheck_test.go +++ b/pkg/filters/proxies/httpproxy/healthcheck_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - "github.com/gorilla/websocket" "github.com/easegress-io/easegress/v2/pkg/filters/proxies" + "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" ) diff --git a/pkg/filters/topicmapper/topicmapper_test.go b/pkg/filters/topicmapper/topicmapper_test.go index 1f8344977b..9a316e77b2 100644 --- a/pkg/filters/topicmapper/topicmapper_test.go +++ b/pkg/filters/topicmapper/topicmapper_test.go @@ -20,9 +20,9 @@ package topicmapper import ( "testing" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/stretchr/testify/assert" ) diff --git a/pkg/object/autocertmanager/autocertmanager_test.go b/pkg/object/autocertmanager/autocertmanager_test.go index 2e5f5ae5e8..7ee45f0025 100644 --- a/pkg/object/autocertmanager/autocertmanager_test.go +++ b/pkg/object/autocertmanager/autocertmanager_test.go @@ -41,12 +41,12 @@ import ( "testing" "time" - "github.com/libdns/libdns" cluster "github.com/easegress-io/easegress/v2/pkg/cluster" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/option" "github.com/easegress-io/easegress/v2/pkg/supervisor" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + "github.com/libdns/libdns" "golang.org/x/crypto/acme" ) diff --git a/pkg/object/autocertmanager/domain.go b/pkg/object/autocertmanager/domain.go index 23bf3aabd6..5506fcecd0 100644 --- a/pkg/object/autocertmanager/domain.go +++ b/pkg/object/autocertmanager/domain.go @@ -30,8 +30,8 @@ import ( "sync/atomic" "time" - "github.com/libdns/libdns" "github.com/easegress-io/easegress/v2/pkg/logger" + "github.com/libdns/libdns" "golang.org/x/crypto/acme" ) diff --git a/pkg/object/grpcserver/mux.go b/pkg/object/grpcserver/mux.go index 18d7f46b59..b25463d35b 100644 --- a/pkg/object/grpcserver/mux.go +++ b/pkg/object/grpcserver/mux.go @@ -31,7 +31,6 @@ import ( "strings" "sync/atomic" - lru "github.com/hashicorp/golang-lru" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/object/globalfilter" @@ -39,6 +38,7 @@ import ( "github.com/easegress-io/easegress/v2/pkg/tracing" "github.com/easegress-io/easegress/v2/pkg/util/ipfilter" "github.com/easegress-io/easegress/v2/pkg/util/stringtool" + lru "github.com/hashicorp/golang-lru" ) type ( diff --git a/pkg/object/httpserver/mux.go b/pkg/object/httpserver/mux.go index 900b49abf9..f5219a845d 100644 --- a/pkg/object/httpserver/mux.go +++ b/pkg/object/httpserver/mux.go @@ -32,9 +32,9 @@ import ( "github.com/easegress-io/easegress/v2/pkg/object/httpserver/routers" - lru "github.com/hashicorp/golang-lru" "github.com/easegress-io/easegress/v2/pkg/object/globalfilter" "github.com/easegress-io/easegress/v2/pkg/protocols/httpprot" + lru "github.com/hashicorp/golang-lru" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/logger" diff --git a/pkg/object/meshcontroller/api/api_customresource.go b/pkg/object/meshcontroller/api/api_customresource.go index 86c00717c3..f94bc29874 100644 --- a/pkg/object/meshcontroller/api/api_customresource.go +++ b/pkg/object/meshcontroller/api/api_customresource.go @@ -22,11 +22,11 @@ import ( "net/http" "sort" - "github.com/go-chi/chi/v5" "github.com/easegress-io/easegress/v2/pkg/api" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/object/meshcontroller/spec" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + "github.com/go-chi/chi/v5" "github.com/megaease/easemesh-api/v2alpha1" "github.com/xeipuuv/gojsonschema" ) diff --git a/pkg/object/mqttproxy/broker.go b/pkg/object/mqttproxy/broker.go index 6a24af4982..3cab5d6352 100644 --- a/pkg/object/mqttproxy/broker.go +++ b/pkg/object/mqttproxy/broker.go @@ -31,13 +31,13 @@ import ( "sync/atomic" "time" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/api" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" "github.com/easegress-io/easegress/v2/pkg/tracing" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/openzipkin/zipkin-go/model" "github.com/openzipkin/zipkin-go/propagation/b3" ) diff --git a/pkg/object/mqttproxy/client.go b/pkg/object/mqttproxy/client.go index 8cc7a2d19d..390dd6a75e 100644 --- a/pkg/object/mqttproxy/client.go +++ b/pkg/object/mqttproxy/client.go @@ -25,10 +25,10 @@ import ( "sync/atomic" "time" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" ) const ( diff --git a/pkg/object/mqttproxy/mock_test.go b/pkg/object/mqttproxy/mock_test.go index 84fe4e7590..731ff87e4f 100644 --- a/pkg/object/mqttproxy/mock_test.go +++ b/pkg/object/mqttproxy/mock_test.go @@ -25,11 +25,11 @@ import ( "testing" "time" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/cluster" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" "github.com/easegress-io/easegress/v2/pkg/protocols/mqttprot" + "github.com/eclipse/paho.mqtt.golang/packets" "go.etcd.io/etcd/api/v3/mvccpb" clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/client/v3/concurrency" diff --git a/pkg/object/mqttproxy/mqtt_test.go b/pkg/object/mqttproxy/mqtt_test.go index a93dbda823..2461485816 100644 --- a/pkg/object/mqttproxy/mqtt_test.go +++ b/pkg/object/mqttproxy/mqtt_test.go @@ -33,8 +33,6 @@ import ( "testing" "time" - paho "github.com/eclipse/paho.mqtt.golang" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/context" "github.com/easegress-io/easegress/v2/pkg/filters" _ "github.com/easegress-io/easegress/v2/pkg/filters/mqttclientauth" @@ -43,6 +41,8 @@ import ( "github.com/easegress-io/easegress/v2/pkg/option" "github.com/easegress-io/easegress/v2/pkg/supervisor" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + paho "github.com/eclipse/paho.mqtt.golang" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/openzipkin/zipkin-go/propagation/b3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/object/mqttproxy/session.go b/pkg/object/mqttproxy/session.go index 1b7e3142d0..ac655b5bfe 100644 --- a/pkg/object/mqttproxy/session.go +++ b/pkg/object/mqttproxy/session.go @@ -23,9 +23,9 @@ import ( "sync/atomic" "time" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/logger" "github.com/easegress-io/easegress/v2/pkg/util/codectool" + "github.com/eclipse/paho.mqtt.golang/packets" "github.com/openzipkin/zipkin-go/model" ) diff --git a/pkg/object/mqttproxy/session_manager.go b/pkg/object/mqttproxy/session_manager.go index 7177be6016..23870ad0e2 100644 --- a/pkg/object/mqttproxy/session_manager.go +++ b/pkg/object/mqttproxy/session_manager.go @@ -20,8 +20,8 @@ package mqttproxy import ( "sync" - "github.com/eclipse/paho.mqtt.golang/packets" "github.com/easegress-io/easegress/v2/pkg/logger" + "github.com/eclipse/paho.mqtt.golang/packets" ) type ( diff --git a/pkg/object/serviceregistry/watcher.go b/pkg/object/serviceregistry/watcher.go index 7f6f96bda3..6833ee9012 100644 --- a/pkg/object/serviceregistry/watcher.go +++ b/pkg/object/serviceregistry/watcher.go @@ -20,8 +20,8 @@ package serviceregistry import ( "fmt" - "github.com/google/uuid" "github.com/easegress-io/easegress/v2/pkg/logger" + "github.com/google/uuid" ) type (