diff --git a/api/api_test.go b/api/api_test.go index 0b183b5db..19bc17011 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -1,10 +1,11 @@ package api import ( - "github.com/semaphoreui/semaphore/util" "net/http" "net/http/httptest" "testing" + + "github.com/semaphoreui/semaphore/util" ) func TestApiPing(t *testing.T) { diff --git a/api/apps.go b/api/apps.go index 2c924a1c6..5ed9e5641 100644 --- a/api/apps.go +++ b/api/apps.go @@ -4,13 +4,14 @@ import ( "encoding/json" "errors" "fmt" + "net/http" + "reflect" + "sort" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/conv" "github.com/semaphoreui/semaphore/util" - "net/http" - "reflect" - "sort" ) func validateAppID(str string) error { diff --git a/api/apps_test.go b/api/apps_test.go index 670774edc..19b5cb2c1 100644 --- a/api/apps_test.go +++ b/api/apps_test.go @@ -2,8 +2,9 @@ package api import ( "fmt" - "github.com/semaphoreui/semaphore/pkg/conv" "testing" + + "github.com/semaphoreui/semaphore/pkg/conv" ) func TestStructToMap(t *testing.T) { diff --git a/api/cache.go b/api/cache.go index f207864d9..d19e14422 100644 --- a/api/cache.go +++ b/api/cache.go @@ -1,11 +1,12 @@ package api import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/util" log "github.com/sirupsen/logrus" - "net/http" ) func clearCache(w http.ResponseWriter, r *http.Request) { diff --git a/api/events.go b/api/events.go index fa3e722ff..401bfacd8 100644 --- a/api/events.go +++ b/api/events.go @@ -1,9 +1,10 @@ package api import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" - "net/http" ) // nolint: gocyclo diff --git a/api/helpers/event_log.go b/api/helpers/event_log.go index 241d229f7..8f1268b67 100644 --- a/api/helpers/event_log.go +++ b/api/helpers/event_log.go @@ -1,10 +1,11 @@ package helpers import ( + "net/http" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pro_interfaces" log "github.com/sirupsen/logrus" - "net/http" ) type EventLogItem struct { diff --git a/api/helpers/query_params.go b/api/helpers/query_params.go index d7c6485b9..aa67a31cb 100644 --- a/api/helpers/query_params.go +++ b/api/helpers/query_params.go @@ -1,10 +1,11 @@ package helpers import ( - "github.com/semaphoreui/semaphore/db" "net/url" "slices" "strconv" + + "github.com/semaphoreui/semaphore/db" ) func QueryParamsForProps(url *url.URL, props db.ObjectProps) (params db.RetrieveQueryParams) { diff --git a/api/options.go b/api/options.go index 57cad2d04..41a14ca60 100644 --- a/api/options.go +++ b/api/options.go @@ -1,9 +1,10 @@ package api import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" - "net/http" ) func setOption(w http.ResponseWriter, r *http.Request) { diff --git a/api/projects/environment.go b/api/projects/environment.go index efcb7eaf4..4027602ed 100644 --- a/api/projects/environment.go +++ b/api/projects/environment.go @@ -3,11 +3,12 @@ package projects import ( "errors" "fmt" + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/random" "github.com/semaphoreui/semaphore/services/server" - "net/http" ) type EnvironmentController struct { diff --git a/api/projects/integration_alias.go b/api/projects/integration_alias.go index 5641b4774..f32191fe7 100644 --- a/api/projects/integration_alias.go +++ b/api/projects/integration_alias.go @@ -1,11 +1,12 @@ package projects import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/random" "github.com/semaphoreui/semaphore/util" - "net/http" ) type publicAlias struct { diff --git a/api/projects/repository.go b/api/projects/repository.go index 7bf7b5729..f10328e7a 100644 --- a/api/projects/repository.go +++ b/api/projects/repository.go @@ -3,11 +3,12 @@ package projects import ( "errors" "fmt" + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/db_lib" "github.com/semaphoreui/semaphore/util" - "net/http" ) // RepositoryMiddleware ensures a repository exists and loads it to the context diff --git a/api/runners.go b/api/runners.go index 42affb266..8a521428b 100644 --- a/api/runners.go +++ b/api/runners.go @@ -3,11 +3,12 @@ package api import ( "bufio" "bytes" + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/util" log "github.com/sirupsen/logrus" - "net/http" ) func getAllRunners(w http.ResponseWriter, r *http.Request) { diff --git a/api/sockets/handler.go b/api/sockets/handler.go index 836f5652c..6b95bd9eb 100644 --- a/api/sockets/handler.go +++ b/api/sockets/handler.go @@ -2,11 +2,12 @@ package sockets import ( "fmt" + "net/http" + "time" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" - "net/http" - "time" "github.com/gorilla/websocket" log "github.com/sirupsen/logrus" diff --git a/api/users.go b/api/users.go index 59160f320..56bb598dd 100644 --- a/api/users.go +++ b/api/users.go @@ -3,14 +3,15 @@ package api import ( "bytes" "fmt" + "image/png" + "net/http" + "github.com/pquerna/otp" "github.com/pquerna/otp/totp" "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pro_interfaces" log "github.com/sirupsen/logrus" - "image/png" - "net/http" "github.com/semaphoreui/semaphore/util" ) diff --git a/cli/cmd/runner.go b/cli/cmd/runner.go index 7e9e07d09..fbb072cd8 100644 --- a/cli/cmd/runner.go +++ b/cli/cmd/runner.go @@ -1,10 +1,11 @@ package cmd import ( + "os" + "github.com/semaphoreui/semaphore/pkg/ssh" "github.com/semaphoreui/semaphore/services/runners" "github.com/spf13/cobra" - "os" ) func createRunnerJobPool() *runners.JobPool { diff --git a/cli/cmd/runner_setup.go b/cli/cmd/runner_setup.go index 4e7aebaeb..ecd95a9c2 100644 --- a/cli/cmd/runner_setup.go +++ b/cli/cmd/runner_setup.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/semaphoreui/semaphore/cli/setup" "github.com/semaphoreui/semaphore/util" "github.com/spf13/cobra" diff --git a/cli/cmd/server.go b/cli/cmd/server.go index b9c23e4d4..45cb9e5a5 100644 --- a/cli/cmd/server.go +++ b/cli/cmd/server.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/spf13/cobra" "net/http" "strings" + + "github.com/spf13/cobra" ) func init() { diff --git a/cli/cmd/user_add.go b/cli/cmd/user_add.go index cfcd46292..14829406b 100644 --- a/cli/cmd/user_add.go +++ b/cli/cmd/user_add.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" + "os" + "github.com/semaphoreui/semaphore/db" "github.com/spf13/cobra" - "os" ) func init() { diff --git a/cli/cmd/user_change.go b/cli/cmd/user_change.go index 861fac466..72cd4503d 100644 --- a/cli/cmd/user_change.go +++ b/cli/cmd/user_change.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" + "os" + "github.com/semaphoreui/semaphore/db" "github.com/spf13/cobra" - "os" ) func init() { diff --git a/cli/cmd/user_delete.go b/cli/cmd/user_delete.go index 8ea6504d8..d81220781 100644 --- a/cli/cmd/user_delete.go +++ b/cli/cmd/user_delete.go @@ -2,8 +2,9 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "os" + + "github.com/spf13/cobra" ) func init() { diff --git a/cli/cmd/user_get.go b/cli/cmd/user_get.go index db3ad3752..502e03db2 100644 --- a/cli/cmd/user_get.go +++ b/cli/cmd/user_get.go @@ -3,9 +3,10 @@ package cmd import ( "errors" "fmt" + "os" + "github.com/semaphoreui/semaphore/db" "github.com/spf13/cobra" - "os" ) func init() { diff --git a/cli/cmd/user_list.go b/cli/cmd/user_list.go index 0290731bd..274c5cbf1 100644 --- a/cli/cmd/user_list.go +++ b/cli/cmd/user_list.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/semaphoreui/semaphore/db" "github.com/spf13/cobra" ) diff --git a/cli/cmd/user_totp.go b/cli/cmd/user_totp.go index c3c84fe16..48adaf016 100644 --- a/cli/cmd/user_totp.go +++ b/cli/cmd/user_totp.go @@ -2,11 +2,12 @@ package cmd import ( "fmt" + "os" + "github.com/mdp/qrterminal/v3" "github.com/pquerna/otp/totp" "github.com/semaphoreui/semaphore/util" "github.com/spf13/cobra" - "os" ) func init() { diff --git a/db/Environment_test.go b/db/Environment_test.go index 2a0058190..89dee8a0c 100644 --- a/db/Environment_test.go +++ b/db/Environment_test.go @@ -1,8 +1,9 @@ package db import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func Test_EnvironmentValidate_EmptyName_ReturnsError(t *testing.T) { diff --git a/db/Event.go b/db/Event.go index 956636ac3..fcd3be316 100644 --- a/db/Event.go +++ b/db/Event.go @@ -1,8 +1,9 @@ package db import ( - log "github.com/sirupsen/logrus" "time" + + log "github.com/sirupsen/logrus" ) // Event represents information generated by ansible or api action captured to the database during execution diff --git a/db/bolt/Task_test.go b/db/bolt/Task_test.go index 6ec754c7d..f566c54bb 100644 --- a/db/bolt/Task_test.go +++ b/db/bolt/Task_test.go @@ -1,8 +1,9 @@ package bolt import ( - "github.com/semaphoreui/semaphore/db" "testing" + + "github.com/semaphoreui/semaphore/db" ) func TestTask_GetVersion(t *testing.T) { diff --git a/db/bolt/event.go b/db/bolt/event.go index 584c610df..25f259657 100644 --- a/db/bolt/event.go +++ b/db/bolt/event.go @@ -2,6 +2,7 @@ package bolt import ( "encoding/json" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" "go.etcd.io/bbolt" diff --git a/db/bolt/global_runner.go b/db/bolt/global_runner.go index 055d31a8e..1318ffdf3 100644 --- a/db/bolt/global_runner.go +++ b/db/bolt/global_runner.go @@ -2,6 +2,7 @@ package bolt import ( "encoding/base64" + "github.com/gorilla/securecookie" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" diff --git a/db/bolt/global_runner_test.go b/db/bolt/global_runner_test.go index 8f2d3ef85..d58e210d5 100644 --- a/db/bolt/global_runner_test.go +++ b/db/bolt/global_runner_test.go @@ -1,9 +1,10 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/stretchr/testify/assert" - "testing" ) func Test_GetRunnerByToken_ReturnsGlobalRunnerWhenTokenExists(t *testing.T) { diff --git a/db/bolt/integrations_alias.go b/db/bolt/integrations_alias.go index fc003495a..b7d0a2ede 100644 --- a/db/bolt/integrations_alias.go +++ b/db/bolt/integrations_alias.go @@ -1,8 +1,9 @@ package bolt import ( - "github.com/semaphoreui/semaphore/db" "reflect" + + "github.com/semaphoreui/semaphore/db" ) var integrationAliasProps = db.ObjectProps{ diff --git a/db/bolt/migration_2_10_12_test.go b/db/bolt/migration_2_10_12_test.go index 97960ca1c..885676f91 100644 --- a/db/bolt/migration_2_10_12_test.go +++ b/db/bolt/migration_2_10_12_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_10_12_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_10_16_test.go b/db/bolt/migration_2_10_16_test.go index 8ec8639a6..0b23eeed9 100644 --- a/db/bolt/migration_2_10_16_test.go +++ b/db/bolt/migration_2_10_16_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_10_16_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_10_24_test.go b/db/bolt/migration_2_10_24_test.go index 0fe010a23..11b901238 100644 --- a/db/bolt/migration_2_10_24_test.go +++ b/db/bolt/migration_2_10_24_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_10_24_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_10_33_test.go b/db/bolt/migration_2_10_33_test.go index f1cc38fd6..c28d42b15 100644 --- a/db/bolt/migration_2_10_33_test.go +++ b/db/bolt/migration_2_10_33_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_10_33_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_14_7.go b/db/bolt/migration_2_14_7.go index 9faba0262..f00439acd 100644 --- a/db/bolt/migration_2_14_7.go +++ b/db/bolt/migration_2_14_7.go @@ -2,6 +2,7 @@ package bolt import ( "fmt" + "github.com/semaphoreui/semaphore/pkg/conv" ) diff --git a/db/bolt/migration_2_14_7_test.go b/db/bolt/migration_2_14_7_test.go index 7e047df6b..69e43ba42 100644 --- a/db/bolt/migration_2_14_7_test.go +++ b/db/bolt/migration_2_14_7_test.go @@ -1,8 +1,9 @@ package bolt import ( - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_14_7_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_8_40_test.go b/db/bolt/migration_2_8_40_test.go index 6980f45bf..6fae4cb5a 100644 --- a/db/bolt/migration_2_8_40_test.go +++ b/db/bolt/migration_2_8_40_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_8_40_Apply(t *testing.T) { diff --git a/db/bolt/migration_2_8_91_test.go b/db/bolt/migration_2_8_91_test.go index 8bb87e866..2defd8900 100644 --- a/db/bolt/migration_2_8_91_test.go +++ b/db/bolt/migration_2_8_91_test.go @@ -2,8 +2,9 @@ package bolt import ( "encoding/json" - "go.etcd.io/bbolt" "testing" + + "go.etcd.io/bbolt" ) func TestMigration_2_8_91_Apply(t *testing.T) { diff --git a/db/bolt/option.go b/db/bolt/option.go index 37a1ae701..ae2329630 100644 --- a/db/bolt/option.go +++ b/db/bolt/option.go @@ -2,9 +2,10 @@ package bolt import ( "errors" + "strings" + "github.com/semaphoreui/semaphore/db" "go.etcd.io/bbolt" - "strings" ) func (d *BoltDb) GetOptions(params db.RetrieveQueryParams) (res map[string]string, err error) { diff --git a/db/bolt/project_test.go b/db/bolt/project_test.go index 6c77dec59..ec20dffd3 100644 --- a/db/bolt/project_test.go +++ b/db/bolt/project_test.go @@ -1,9 +1,10 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" - "testing" ) func TestGetProjects(t *testing.T) { diff --git a/db/bolt/public_alias.go b/db/bolt/public_alias.go index 5bc9b8a98..a4b516e3a 100644 --- a/db/bolt/public_alias.go +++ b/db/bolt/public_alias.go @@ -3,8 +3,9 @@ package bolt import ( "errors" "fmt" - "github.com/semaphoreui/semaphore/db" "reflect" + + "github.com/semaphoreui/semaphore/db" ) type publicAlias struct { diff --git a/db/bolt/runner_pro.go b/db/bolt/runner_pro.go index 0fab1f279..2e9d3d7fe 100644 --- a/db/bolt/runner_pro.go +++ b/db/bolt/runner_pro.go @@ -2,6 +2,7 @@ package bolt import ( "fmt" + "github.com/semaphoreui/semaphore/db" "go.etcd.io/bbolt" ) diff --git a/db/bolt/runner_pro_test.go b/db/bolt/runner_pro_test.go index ef3bb3521..4a008218b 100644 --- a/db/bolt/runner_pro_test.go +++ b/db/bolt/runner_pro_test.go @@ -1,9 +1,10 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/stretchr/testify/assert" - "testing" ) func Test_DeleteRunner_DeletesProjectRunner(t *testing.T) { diff --git a/db/bolt/session.go b/db/bolt/session.go index 2ad462396..31aa075f2 100644 --- a/db/bolt/session.go +++ b/db/bolt/session.go @@ -1,11 +1,12 @@ package bolt import ( - "github.com/semaphoreui/semaphore/db" - "github.com/semaphoreui/semaphore/pkg/tz" "reflect" "slices" "strings" + + "github.com/semaphoreui/semaphore/db" + "github.com/semaphoreui/semaphore/pkg/tz" ) type globalToken struct { diff --git a/db/bolt/template_test.go b/db/bolt/template_test.go index 1de358ada..6b1a8233e 100644 --- a/db/bolt/template_test.go +++ b/db/bolt/template_test.go @@ -1,9 +1,10 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" - "testing" ) func Test_SetTemplateDescription(t *testing.T) { diff --git a/db/bolt/template_vault_test.go b/db/bolt/template_vault_test.go index 0f2fd4b08..159a707fa 100644 --- a/db/bolt/template_vault_test.go +++ b/db/bolt/template_vault_test.go @@ -1,9 +1,10 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" - "testing" ) func TestGetTemplateVaults(t *testing.T) { diff --git a/db/bolt/user.go b/db/bolt/user.go index 8e7d83585..19c19560a 100644 --- a/db/bolt/user.go +++ b/db/bolt/user.go @@ -2,6 +2,7 @@ package bolt import ( "fmt" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" "golang.org/x/crypto/bcrypt" diff --git a/db/bolt/user_test.go b/db/bolt/user_test.go index 7bff522cb..16a1b6049 100644 --- a/db/bolt/user_test.go +++ b/db/bolt/user_test.go @@ -1,10 +1,11 @@ package bolt import ( + "testing" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" "github.com/stretchr/testify/require" - "testing" ) func TestBoltDb_UpdateProjectUser(t *testing.T) { diff --git a/db/bolt/view_test.go b/db/bolt/view_test.go index d53b8d0e3..ba7ddfe84 100644 --- a/db/bolt/view_test.go +++ b/db/bolt/view_test.go @@ -1,10 +1,11 @@ package bolt import ( - "github.com/semaphoreui/semaphore/db" - "github.com/semaphoreui/semaphore/pkg/tz" "sort" "testing" + + "github.com/semaphoreui/semaphore/db" + "github.com/semaphoreui/semaphore/pkg/tz" ) func TestGetViews(t *testing.T) { diff --git a/db/config.go b/db/config.go index f6aad790b..769ee256b 100644 --- a/db/config.go +++ b/db/config.go @@ -1,8 +1,9 @@ package db import ( - "github.com/semaphoreui/semaphore/util" "strings" + + "github.com/semaphoreui/semaphore/util" ) func ConvertFlatToNested(flatMap map[string]string) map[string]any { diff --git a/db/sql/SqlDb_test.go b/db/sql/SqlDb_test.go index 51777ade0..83feac5da 100644 --- a/db/sql/SqlDb_test.go +++ b/db/sql/SqlDb_test.go @@ -1,8 +1,9 @@ package sql import ( - "github.com/go-gorp/gorp/v3" "testing" + + "github.com/go-gorp/gorp/v3" ) func TestValidatePort(t *testing.T) { diff --git a/db/sql/global_runner.go b/db/sql/global_runner.go index a526d001a..107fbbb50 100644 --- a/db/sql/global_runner.go +++ b/db/sql/global_runner.go @@ -2,6 +2,7 @@ package sql import ( "encoding/base64" + "github.com/Masterminds/squirrel" "github.com/gorilla/securecookie" "github.com/semaphoreui/semaphore/db" diff --git a/db/sql/migration_2_8_28.go b/db/sql/migration_2_8_28.go index 9582c7f6d..2479ea6c9 100644 --- a/db/sql/migration_2_8_28.go +++ b/db/sql/migration_2_8_28.go @@ -1,8 +1,9 @@ package sql import ( - "github.com/go-gorp/gorp/v3" "strings" + + "github.com/go-gorp/gorp/v3" ) type migration_2_8_26 struct { diff --git a/db/sql/option.go b/db/sql/option.go index 5bedcc4af..a48e15385 100644 --- a/db/sql/option.go +++ b/db/sql/option.go @@ -2,6 +2,7 @@ package sql import ( "errors" + "github.com/Masterminds/squirrel" "github.com/semaphoreui/semaphore/db" ) diff --git a/db/sql/runner.go b/db/sql/runner.go index 134ab768d..402110ede 100644 --- a/db/sql/runner.go +++ b/db/sql/runner.go @@ -2,6 +2,7 @@ package sql import ( "fmt" + "github.com/Masterminds/squirrel" "github.com/semaphoreui/semaphore/db" ) diff --git a/db/sql/session.go b/db/sql/session.go index eda31337a..0bec7f4df 100644 --- a/db/sql/session.go +++ b/db/sql/session.go @@ -3,9 +3,10 @@ package sql import ( "database/sql" "errors" + "regexp" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" - "regexp" ) func (d *SqlDb) SetSessionVerificationMethod(userID int, sessionID int, verificationMethod db.SessionVerificationMethod) error { diff --git a/db/sql/template_vault.go b/db/sql/template_vault.go index 45c4318c4..57f66d11d 100644 --- a/db/sql/template_vault.go +++ b/db/sql/template_vault.go @@ -1,9 +1,10 @@ package sql import ( - "github.com/semaphoreui/semaphore/db" "strconv" "strings" + + "github.com/semaphoreui/semaphore/db" ) func (d *SqlDb) GetTemplateVaults(projectID int, templateID int) (vaults []db.TemplateVault, err error) { diff --git a/db/sql/user.go b/db/sql/user.go index 0c70f5eae..417bca35e 100644 --- a/db/sql/user.go +++ b/db/sql/user.go @@ -2,11 +2,12 @@ package sql import ( "errors" + "strings" + "github.com/Masterminds/squirrel" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/tz" "golang.org/x/crypto/bcrypt" - "strings" ) func (d *SqlDb) CreateUserWithoutPassword(user db.User) (newUser db.User, err error) { diff --git a/db_lib/GitRepository.go b/db_lib/GitRepository.go index 1deb49b7a..266dccd8d 100644 --- a/db_lib/GitRepository.go +++ b/db_lib/GitRepository.go @@ -1,12 +1,12 @@ package db_lib import ( - "github.com/semaphoreui/semaphore/util" "os" "path" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/task_logger" + "github.com/semaphoreui/semaphore/util" ) type GitRepositoryDirType int diff --git a/pkg/ssh/agent.go b/pkg/ssh/agent.go index 85d709dbc..bff05f75e 100644 --- a/pkg/ssh/agent.go +++ b/pkg/ssh/agent.go @@ -2,14 +2,14 @@ package ssh import ( "fmt" - "github.com/semaphoreui/semaphore/db" - "github.com/semaphoreui/semaphore/pkg/random" - "github.com/semaphoreui/semaphore/util" "io" "net" "path" + "github.com/semaphoreui/semaphore/db" + "github.com/semaphoreui/semaphore/pkg/random" "github.com/semaphoreui/semaphore/pkg/task_logger" + "github.com/semaphoreui/semaphore/util" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/pkg/ssh/agent_test.go b/pkg/ssh/agent_test.go index e533879e0..93704ef8e 100644 --- a/pkg/ssh/agent_test.go +++ b/pkg/ssh/agent_test.go @@ -49,7 +49,7 @@ func TestAgent_Close_FailedInitialization(t *testing.T) { // 1. StartSSHAgent() fails during Listen() but returns incomplete agent // 2. Install() method assigns the incomplete agent to installation.SSHAgent // 3. Later, destroyKeys() calls Destroy() which calls Close() on incomplete agent - + // Create an agent that would be returned by StartSSHAgent() if Listen() failed incompleteAgent := Agent{ Keys: []AgentKey{ diff --git a/pro/api/projects/runners.go b/pro/api/projects/runners.go index 1fc64b6a1..d458c66f2 100644 --- a/pro/api/projects/runners.go +++ b/pro/api/projects/runners.go @@ -1,10 +1,11 @@ package projects import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pro_interfaces" - "net/http" ) // NewProjectRunnerController creates a new ProjectRunnerController instance. diff --git a/pro/api/projects/terraform_inventory.go b/pro/api/projects/terraform_inventory.go index b69a04097..d2e071f76 100644 --- a/pro/api/projects/terraform_inventory.go +++ b/pro/api/projects/terraform_inventory.go @@ -1,10 +1,11 @@ package projects import ( + "net/http" + "github.com/semaphoreui/semaphore/api/helpers" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pro_interfaces" - "net/http" ) type terraformInventoryController struct{} diff --git a/pro/api/terraform.go b/pro/api/terraform.go index c4fc27aa7..4f3ff2900 100644 --- a/pro/api/terraform.go +++ b/pro/api/terraform.go @@ -1,9 +1,10 @@ package api import ( + "net/http" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/services/server" - "net/http" ) type TerraformController struct { diff --git a/services/project/backup_marshal.go b/services/project/backup_marshal.go index c15477713..74f6863c7 100644 --- a/services/project/backup_marshal.go +++ b/services/project/backup_marshal.go @@ -2,8 +2,9 @@ package project import ( "fmt" - "github.com/semaphoreui/semaphore/db" "reflect" + + "github.com/semaphoreui/semaphore/db" ) func marshalValue(v reflect.Value) (any, error) { diff --git a/services/project/backup_marshal_test.go b/services/project/backup_marshal_test.go index 73be8823a..9bdb0b8fe 100644 --- a/services/project/backup_marshal_test.go +++ b/services/project/backup_marshal_test.go @@ -1,10 +1,11 @@ package project import ( - "github.com/semaphoreui/semaphore/db" - "github.com/stretchr/testify/assert" "reflect" "testing" + + "github.com/semaphoreui/semaphore/db" + "github.com/stretchr/testify/assert" ) func Test_MarshalValue_NilPointer_ReturnsNil(t *testing.T) { diff --git a/services/runners/running_job.go b/services/runners/running_job.go index f873b36b9..5a3b85ebb 100644 --- a/services/runners/running_job.go +++ b/services/runners/running_job.go @@ -3,13 +3,13 @@ package runners import ( "bufio" "fmt" - "github.com/semaphoreui/semaphore/pkg/tz" "io" "os/exec" "sync" "time" "github.com/semaphoreui/semaphore/pkg/task_logger" + "github.com/semaphoreui/semaphore/pkg/tz" "github.com/semaphoreui/semaphore/services/tasks" log "github.com/sirupsen/logrus" ) diff --git a/services/schedules/SchedulePool.go b/services/schedules/SchedulePool.go index 9bcb90321..283f991d1 100644 --- a/services/schedules/SchedulePool.go +++ b/services/schedules/SchedulePool.go @@ -133,10 +133,10 @@ func (r ScheduleRunner) Run() { tpl, err := r.pool.store.GetTemplate(schedule.ProjectID, schedule.TemplateID) if err != nil { log.WithError(err).WithFields(log.Fields{ - "context": common_errors.GetErrorContext(), - "project_id": schedule.ProjectID, - "schedule_id": schedule.ID, - "template_id": schedule.TemplateID, + "context": common_errors.GetErrorContext(), + "project_id": schedule.ProjectID, + "schedule_id": schedule.ID, + "template_id": schedule.TemplateID, }).Error("failed to get template") return } diff --git a/services/server/environment_svc.go b/services/server/environment_svc.go index 4bed349fe..d06460298 100644 --- a/services/server/environment_svc.go +++ b/services/server/environment_svc.go @@ -2,6 +2,7 @@ package server import ( "fmt" + "github.com/semaphoreui/semaphore/db" ) diff --git a/services/session_svc.go b/services/session_svc.go index aa40d13c1..6ef39712e 100644 --- a/services/session_svc.go +++ b/services/session_svc.go @@ -1,11 +1,12 @@ package services import ( + "net/http" + "time" + "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/util" log "github.com/sirupsen/logrus" - "net/http" - "time" ) type SessionService interface { diff --git a/services/tasks/TaskPool_test.go b/services/tasks/TaskPool_test.go index b8abc7f33..0d4347fd5 100644 --- a/services/tasks/TaskPool_test.go +++ b/services/tasks/TaskPool_test.go @@ -85,5 +85,3 @@ func TestTaskPool_RequeuedEventCleansRunningStateAndSkipsImmediateRetry(t *testi assert.Equal(t, 1, state.QueueLen(), "requeued task must remain queued") assert.Equal(t, 0, state.tryClaimCalls, "requeued task should not be immediately retried in the same queue pass") } - - diff --git a/util/OdbcProvider.go b/util/OdbcProvider.go index 24b68f098..f7a4f44bd 100644 --- a/util/OdbcProvider.go +++ b/util/OdbcProvider.go @@ -17,7 +17,7 @@ type OidcProvider struct { EmailClaim string `json:"email_claim" default:"email"` Order int `json:"order"` // ReturnViaState when true, passes the return path via the OAuth state parameter instead of the redirect URL path. This is useful for OAuth providers that have strict redirect URL validation. - ReturnViaState bool `json:"return_via_state"` + ReturnViaState bool `json:"return_via_state"` } type ClaimsProvider interface { diff --git a/util/debug.go b/util/debug.go index 5c1d0d214..175155357 100644 --- a/util/debug.go +++ b/util/debug.go @@ -1,10 +1,11 @@ package util import ( - log "github.com/sirupsen/logrus" "runtime" "strconv" "strings" + + log "github.com/sirupsen/logrus" ) func Goid() (int, error) { diff --git a/util/test_helpers.go b/util/test_helpers.go index 44c30b5b8..16cd6da6d 100644 --- a/util/test_helpers.go +++ b/util/test_helpers.go @@ -1,8 +1,9 @@ package util import ( - "github.com/semaphoreui/semaphore/pkg/tz" "math/rand" + + "github.com/semaphoreui/semaphore/pkg/tz" ) //HELPERS