diff --git a/examples/grpc-server/grpc/hello_server.go b/examples/grpc-server/grpc/hello_server.go index 01db800b9..07ce41ebb 100644 --- a/examples/grpc-server/grpc/hello_server.go +++ b/examples/grpc-server/grpc/hello_server.go @@ -2,6 +2,7 @@ package grpc import ( "fmt" + "gofr.dev/pkg/gofr" ) diff --git a/examples/grpc-server/grpc/hello_server_test.go b/examples/grpc-server/grpc/hello_server_test.go index 725dd63f5..93d7b33e4 100644 --- a/examples/grpc-server/grpc/hello_server_test.go +++ b/examples/grpc-server/grpc/hello_server_test.go @@ -2,11 +2,12 @@ package grpc import ( "context" - "gofr.dev/pkg/gofr" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "gofr.dev/pkg/gofr" ) func TestServer_SayHello(t *testing.T) { diff --git a/examples/sample-cmd/main_test.go b/examples/sample-cmd/main_test.go index 952dd3025..5c8c56b0f 100644 --- a/examples/sample-cmd/main_test.go +++ b/examples/sample-cmd/main_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr" "gofr.dev/pkg/gofr/cmd" "gofr.dev/pkg/gofr/cmd/terminal" diff --git a/examples/using-cron-jobs/main_test.go b/examples/using-cron-jobs/main_test.go index f1cbcf14a..65957e095 100644 --- a/examples/using-cron-jobs/main_test.go +++ b/examples/using-cron-jobs/main_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/examples/using-custom-metrics/main_test.go b/examples/using-custom-metrics/main_test.go index d9b9b37c0..bc85d7acf 100644 --- a/examples/using-custom-metrics/main_test.go +++ b/examples/using-custom-metrics/main_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/examples/using-file-bind/main_test.go b/examples/using-file-bind/main_test.go index 38548ba13..5d6cd928e 100644 --- a/examples/using-file-bind/main_test.go +++ b/examples/using-file-bind/main_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/examples/using-migrations/main_test.go b/examples/using-migrations/main_test.go index b9a8da5cf..c4197aa1f 100644 --- a/examples/using-migrations/main_test.go +++ b/examples/using-migrations/main_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/examples/using-publisher/main_test.go b/examples/using-publisher/main_test.go index fd59c85de..c9b3b72bd 100644 --- a/examples/using-publisher/main_test.go +++ b/examples/using-publisher/main_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/examples/using-web-socket/main_test.go b/examples/using-web-socket/main_test.go index d78177853..1faef6071 100644 --- a/examples/using-web-socket/main_test.go +++ b/examples/using-web-socket/main_test.go @@ -8,6 +8,7 @@ import ( "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/testutil" ) diff --git a/pkg/gofr/container/health_test.go b/pkg/gofr/container/health_test.go index 474bcbb35..57ea33f20 100644 --- a/pkg/gofr/container/health_test.go +++ b/pkg/gofr/container/health_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/datasource" "gofr.dev/pkg/gofr/datasource/sql" "gofr.dev/pkg/gofr/logging" diff --git a/pkg/gofr/container/mock_container.go b/pkg/gofr/container/mock_container.go index 02959c6d4..8d36eb8c4 100644 --- a/pkg/gofr/container/mock_container.go +++ b/pkg/gofr/container/mock_container.go @@ -7,6 +7,7 @@ import ( "testing" "go.uber.org/mock/gomock" + "gofr.dev/pkg/gofr/datasource" "gofr.dev/pkg/gofr/datasource/file" "gofr.dev/pkg/gofr/datasource/pubsub" diff --git a/pkg/gofr/container/sql_mock.go b/pkg/gofr/container/sql_mock.go index 4f7f274d4..27eda8d7a 100644 --- a/pkg/gofr/container/sql_mock.go +++ b/pkg/gofr/container/sql_mock.go @@ -8,6 +8,7 @@ import ( "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/require" + "gofr.dev/pkg/gofr/datasource" gofrSQL "gofr.dev/pkg/gofr/datasource/sql" "gofr.dev/pkg/gofr/logging" diff --git a/pkg/gofr/context.go b/pkg/gofr/context.go index 9f4cd29a3..931a715a5 100644 --- a/pkg/gofr/context.go +++ b/pkg/gofr/context.go @@ -5,7 +5,6 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/gorilla/websocket" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" diff --git a/pkg/gofr/datasource/cassandra/cassandra.go b/pkg/gofr/datasource/cassandra/cassandra.go index 5b7b89985..7186da446 100644 --- a/pkg/gofr/datasource/cassandra/cassandra.go +++ b/pkg/gofr/datasource/cassandra/cassandra.go @@ -7,10 +7,9 @@ import ( "reflect" "time" + "github.com/gocql/gocql" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - - "github.com/gocql/gocql" ) const ( diff --git a/pkg/gofr/datasource/cassandra/cassandra_test.go b/pkg/gofr/datasource/cassandra/cassandra_test.go index ef0381ce5..347a15bee 100644 --- a/pkg/gofr/datasource/cassandra/cassandra_test.go +++ b/pkg/gofr/datasource/cassandra/cassandra_test.go @@ -5,11 +5,10 @@ import ( "errors" "testing" - "go.opentelemetry.io/otel" - "github.com/gocql/gocql" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" "go.uber.org/mock/gomock" ) diff --git a/pkg/gofr/datasource/clickhouse/clickhouse.go b/pkg/gofr/datasource/clickhouse/clickhouse.go index 78908cba5..76af875fd 100644 --- a/pkg/gofr/datasource/clickhouse/clickhouse.go +++ b/pkg/gofr/datasource/clickhouse/clickhouse.go @@ -7,11 +7,9 @@ import ( "strings" "time" + "github.com/ClickHouse/clickhouse-go/v2" "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" - - "github.com/ClickHouse/clickhouse-go/v2" ) type Config struct { diff --git a/pkg/gofr/datasource/dgraph/dgraph.go b/pkg/gofr/datasource/dgraph/dgraph.go index a36e4de13..339065500 100644 --- a/pkg/gofr/datasource/dgraph/dgraph.go +++ b/pkg/gofr/datasource/dgraph/dgraph.go @@ -8,11 +8,10 @@ import ( "fmt" "time" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" - "github.com/dgraph-io/dgo/v210" "github.com/dgraph-io/dgo/v210/protos/api" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/pkg/gofr/datasource/dgraph/dgraph_test.go b/pkg/gofr/datasource/dgraph/dgraph_test.go index 09e7deb78..f9d30809b 100644 --- a/pkg/gofr/datasource/dgraph/dgraph_test.go +++ b/pkg/gofr/datasource/dgraph/dgraph_test.go @@ -5,11 +5,10 @@ import ( "errors" "testing" - "go.opentelemetry.io/otel" - "go.uber.org/mock/gomock" - "github.com/dgraph-io/dgo/v210/protos/api" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" + "go.uber.org/mock/gomock" ) var ( diff --git a/pkg/gofr/datasource/file/ftp/file.go b/pkg/gofr/datasource/file/ftp/file.go index fc16129dc..1fcb0e4a1 100644 --- a/pkg/gofr/datasource/file/ftp/file.go +++ b/pkg/gofr/datasource/file/ftp/file.go @@ -14,7 +14,6 @@ import ( "time" "github.com/jlaffaye/ftp" - file_interface "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/ftp/fs.go b/pkg/gofr/datasource/file/ftp/fs.go index 85e5908db..2b7397395 100644 --- a/pkg/gofr/datasource/file/ftp/fs.go +++ b/pkg/gofr/datasource/file/ftp/fs.go @@ -10,7 +10,6 @@ import ( "time" "github.com/jlaffaye/ftp" - file_interface "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/ftp/fs_dir.go b/pkg/gofr/datasource/file/ftp/fs_dir.go index 021647ba4..9def89f91 100644 --- a/pkg/gofr/datasource/file/ftp/fs_dir.go +++ b/pkg/gofr/datasource/file/ftp/fs_dir.go @@ -8,7 +8,6 @@ import ( "time" "github.com/jlaffaye/ftp" - file_interface "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/ftp/fs_test.go b/pkg/gofr/datasource/file/ftp/fs_test.go index 5af8aeb4c..259685f6b 100644 --- a/pkg/gofr/datasource/file/ftp/fs_test.go +++ b/pkg/gofr/datasource/file/ftp/fs_test.go @@ -10,10 +10,9 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/jlaffaye/ftp" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) diff --git a/pkg/gofr/datasource/file/s3/file_parse.go b/pkg/gofr/datasource/file/s3/file_parse.go index 16eacce1b..1844335bd 100644 --- a/pkg/gofr/datasource/file/s3/file_parse.go +++ b/pkg/gofr/datasource/file/s3/file_parse.go @@ -13,7 +13,6 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/aws" - file "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/s3/fs.go b/pkg/gofr/datasource/file/s3/fs.go index 431ef5e56..5f1ee069a 100644 --- a/pkg/gofr/datasource/file/s3/fs.go +++ b/pkg/gofr/datasource/file/s3/fs.go @@ -14,7 +14,6 @@ import ( awsConfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/s3" - file "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/s3/fs_dir.go b/pkg/gofr/datasource/file/s3/fs_dir.go index e4d2071f6..2d6e59d63 100644 --- a/pkg/gofr/datasource/file/s3/fs_dir.go +++ b/pkg/gofr/datasource/file/s3/fs_dir.go @@ -11,11 +11,9 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go-v2/service/s3/types" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/s3" - + "github.com/aws/aws-sdk-go-v2/service/s3/types" file "gofr.dev/pkg/gofr/datasource/file" ) diff --git a/pkg/gofr/datasource/file/s3/fs_test.go b/pkg/gofr/datasource/file/s3/fs_test.go index c2bf392f9..e719048a4 100644 --- a/pkg/gofr/datasource/file/s3/fs_test.go +++ b/pkg/gofr/datasource/file/s3/fs_test.go @@ -10,11 +10,10 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/aws/aws-sdk-go-v2/service/s3" "go.uber.org/mock/gomock" ) diff --git a/pkg/gofr/datasource/file/sftp/fs.go b/pkg/gofr/datasource/file/sftp/fs.go index 522b8733f..bd8ceeb81 100644 --- a/pkg/gofr/datasource/file/sftp/fs.go +++ b/pkg/gofr/datasource/file/sftp/fs.go @@ -6,10 +6,8 @@ import ( "time" "github.com/pkg/sftp" - - "golang.org/x/crypto/ssh" - File "gofr.dev/pkg/gofr/datasource/file" + "golang.org/x/crypto/ssh" ) const ( diff --git a/pkg/gofr/datasource/kv-store/badger/badger.go b/pkg/gofr/datasource/kv-store/badger/badger.go index be3b0f665..4d531cb7e 100644 --- a/pkg/gofr/datasource/kv-store/badger/badger.go +++ b/pkg/gofr/datasource/kv-store/badger/badger.go @@ -7,10 +7,9 @@ import ( "strings" "time" + "github.com/dgraph-io/badger/v4" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - - "github.com/dgraph-io/badger/v4" ) var errStatusDown = errors.New("status down") diff --git a/pkg/gofr/datasource/mongo/mongo.go b/pkg/gofr/datasource/mongo/mongo.go index bfdf6fba4..29558e7ec 100644 --- a/pkg/gofr/datasource/mongo/mongo.go +++ b/pkg/gofr/datasource/mongo/mongo.go @@ -9,13 +9,12 @@ import ( "strconv" "time" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" - "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/readpref" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" ) type Client struct { diff --git a/pkg/gofr/datasource/pubsub/eventhub/eventhub.go b/pkg/gofr/datasource/pubsub/eventhub/eventhub.go index 02406348d..a6c9be8ed 100644 --- a/pkg/gofr/datasource/pubsub/eventhub/eventhub.go +++ b/pkg/gofr/datasource/pubsub/eventhub/eventhub.go @@ -6,12 +6,10 @@ import ( "strings" "time" - "go.opentelemetry.io/otel/trace" - "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/checkpoints" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container" - + "go.opentelemetry.io/otel/trace" "gofr.dev/pkg/gofr/datasource" "gofr.dev/pkg/gofr/datasource/pubsub" ) diff --git a/pkg/gofr/datasource/pubsub/eventhub/eventhub_test.go b/pkg/gofr/datasource/pubsub/eventhub/eventhub_test.go index bbfaeced0..fd2c6fdbf 100644 --- a/pkg/gofr/datasource/pubsub/eventhub/eventhub_test.go +++ b/pkg/gofr/datasource/pubsub/eventhub/eventhub_test.go @@ -7,12 +7,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" "github.com/stretchr/testify/require" - - "nhooyr.io/websocket" - "go.uber.org/mock/gomock" - "gofr.dev/pkg/gofr/testutil" + "nhooyr.io/websocket" ) func TestConnect(t *testing.T) { diff --git a/pkg/gofr/datasource/pubsub/eventhub/logger_test.go b/pkg/gofr/datasource/pubsub/eventhub/logger_test.go index e105a6b5a..83c4fe5dd 100644 --- a/pkg/gofr/datasource/pubsub/eventhub/logger_test.go +++ b/pkg/gofr/datasource/pubsub/eventhub/logger_test.go @@ -4,9 +4,8 @@ import ( "bytes" "testing" - "go.uber.org/mock/gomock" - "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_PrettyPrint(t *testing.T) { diff --git a/pkg/gofr/datasource/pubsub/mqtt/default_client.go b/pkg/gofr/datasource/pubsub/mqtt/default_client.go index 8afd772aa..36c04c66b 100644 --- a/pkg/gofr/datasource/pubsub/mqtt/default_client.go +++ b/pkg/gofr/datasource/pubsub/mqtt/default_client.go @@ -5,7 +5,6 @@ import ( "sync" mqtt "github.com/eclipse/paho.mqtt.golang" - "github.com/google/uuid" ) diff --git a/pkg/gofr/datasource/pubsub/nats/connection_manager.go b/pkg/gofr/datasource/pubsub/nats/connection_manager.go index 207a70360..33aac276e 100644 --- a/pkg/gofr/datasource/pubsub/nats/connection_manager.go +++ b/pkg/gofr/datasource/pubsub/nats/connection_manager.go @@ -5,7 +5,6 @@ import ( "github.com/nats-io/nats.go" "github.com/nats-io/nats.go/jetstream" - "gofr.dev/pkg/gofr/datasource" "gofr.dev/pkg/gofr/datasource/pubsub" ) diff --git a/pkg/gofr/datasource/pubsub/nats/interfaces.go b/pkg/gofr/datasource/pubsub/nats/interfaces.go index 758db2d99..251b4b401 100644 --- a/pkg/gofr/datasource/pubsub/nats/interfaces.go +++ b/pkg/gofr/datasource/pubsub/nats/interfaces.go @@ -5,7 +5,6 @@ import ( "github.com/nats-io/nats.go" "github.com/nats-io/nats.go/jetstream" - "gofr.dev/pkg/gofr/datasource" "gofr.dev/pkg/gofr/datasource/pubsub" ) diff --git a/pkg/gofr/datasource/pubsub/nats/message_test.go b/pkg/gofr/datasource/pubsub/nats/message_test.go index 32d91886d..971772c65 100644 --- a/pkg/gofr/datasource/pubsub/nats/message_test.go +++ b/pkg/gofr/datasource/pubsub/nats/message_test.go @@ -5,7 +5,6 @@ import ( "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" - "gofr.dev/pkg/gofr/logging" "gofr.dev/pkg/gofr/testutil" ) diff --git a/pkg/gofr/datasource/scylladb/internal.go b/pkg/gofr/datasource/scylladb/internal.go index 619eed1f8..1c1135f78 100644 --- a/pkg/gofr/datasource/scylladb/internal.go +++ b/pkg/gofr/datasource/scylladb/internal.go @@ -9,9 +9,7 @@ import ( "github.com/gocql/gocql" "github.com/stoewer/go-strcase" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" ) diff --git a/pkg/gofr/datasource/scylladb/scylladb_test.go b/pkg/gofr/datasource/scylladb/scylladb_test.go index 348f05288..c73b25f40 100644 --- a/pkg/gofr/datasource/scylladb/scylladb_test.go +++ b/pkg/gofr/datasource/scylladb/scylladb_test.go @@ -7,7 +7,6 @@ import ( "github.com/gocql/gocql" "github.com/stretchr/testify/assert" - "go.uber.org/mock/gomock" ) diff --git a/pkg/gofr/datasource/solr/solr.go b/pkg/gofr/datasource/solr/solr.go index 308784e08..b94623dab 100644 --- a/pkg/gofr/datasource/solr/solr.go +++ b/pkg/gofr/datasource/solr/solr.go @@ -11,7 +11,6 @@ import ( "time" "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace" - "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) diff --git a/pkg/gofr/handler_test.go b/pkg/gofr/handler_test.go index bc4114160..58e938ad3 100644 --- a/pkg/gofr/handler_test.go +++ b/pkg/gofr/handler_test.go @@ -11,8 +11,6 @@ import ( "testing" "time" - "gofr.dev/pkg/gofr/testutil" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -20,6 +18,7 @@ import ( gofrHTTP "gofr.dev/pkg/gofr/http" "gofr.dev/pkg/gofr/http/response" "gofr.dev/pkg/gofr/logging" + "gofr.dev/pkg/gofr/testutil" ) var ( diff --git a/pkg/gofr/http/responder_test.go b/pkg/gofr/http/responder_test.go index a2e8ddc51..378b7cefb 100644 --- a/pkg/gofr/http/responder_test.go +++ b/pkg/gofr/http/responder_test.go @@ -6,10 +6,10 @@ import ( "net/http/httptest" "testing" - resTypes "gofr.dev/pkg/gofr/http/response" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + resTypes "gofr.dev/pkg/gofr/http/response" ) func TestResponder(t *testing.T) { diff --git a/pkg/gofr/http/router.go b/pkg/gofr/http/router.go index 137e260f2..7da21de5a 100644 --- a/pkg/gofr/http/router.go +++ b/pkg/gofr/http/router.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/gorilla/mux" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) diff --git a/pkg/gofr/http/router_test.go b/pkg/gofr/http/router_test.go index 3baf743a0..43749cca2 100644 --- a/pkg/gofr/http/router_test.go +++ b/pkg/gofr/http/router_test.go @@ -2,7 +2,6 @@ package http import ( "fmt" - "net/http" "net/http/httptest" "os" @@ -11,6 +10,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/config" "gofr.dev/pkg/gofr/container" "gofr.dev/pkg/gofr/testutil" diff --git a/pkg/gofr/migration/mongo_test.go b/pkg/gofr/migration/mongo_test.go index 3c31cc1fe..713e306e1 100644 --- a/pkg/gofr/migration/mongo_test.go +++ b/pkg/gofr/migration/mongo_test.go @@ -7,6 +7,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "gofr.dev/pkg/gofr/container" )