This is an automated email from the ASF dual-hosted git repository. linkinstar pushed a commit to branch feat/1.7.1/goimports in repository https://gitbox.apache.org/repos/asf/answer.git
commit 102b295f047d7fee665556f811d43df4e2468708 Author: LinkinStars <[email protected]> AuthorDate: Mon Dec 1 11:30:42 2025 +0800 refactor(goimports): add goimports to golangci-lint configuration #1432 --- .golangci.yaml | 1 + internal/base/handler/handler.go | 3 ++- internal/base/middleware/accept_language.go | 3 ++- internal/base/middleware/rate_limit.go | 1 + internal/cli/config.go | 1 + internal/cli/i18n.go | 7 ++++--- internal/controller/template_render/comment.go | 1 + internal/controller/user_plugin_controller.go | 3 ++- internal/entity/badge_entity.go | 3 ++- internal/entity/config_entity.go | 1 + internal/migrations/v1.go | 1 + internal/migrations/v13.go | 1 + internal/migrations/v14.go | 1 + internal/migrations/v15.go | 1 + internal/migrations/v16.go | 1 + internal/migrations/v17.go | 1 + internal/migrations/v18.go | 1 + internal/migrations/v19.go | 1 + internal/migrations/v2.go | 1 + internal/migrations/v21.go | 1 + internal/migrations/v22.go | 1 + internal/migrations/v24.go | 1 + internal/repo/activity/answer_repo.go | 3 ++- internal/repo/activity/user_active_repo.go | 1 + internal/repo/activity_common/vote.go | 1 + internal/repo/auth/auth.go | 1 + internal/repo/badge/badge_event_rule.go | 3 ++- internal/repo/badge/badge_repo.go | 1 + internal/repo/badge_award/badge_award_repo.go | 1 + internal/repo/badge_group/badge_group_repo.go | 1 + internal/repo/collection/collection_repo.go | 1 + internal/repo/export/email_repo.go | 3 ++- internal/repo/limit/limit.go | 3 ++- internal/repo/meta/meta_repo.go | 2 +- internal/repo/plugin_config/plugin_user_config_repo.go | 1 + internal/repo/search_sync/search_sync.go | 1 + .../repo/user_notification_config/user_notification_config_repo.go | 1 + internal/schema/email_template.go | 1 + internal/schema/notification_schema.go | 3 ++- internal/schema/user_notification_schema.go | 1 + internal/service/activity/activity.go | 2 +- internal/service/activity/answer_activity_service.go | 1 + internal/service/badge/badge_award_service.go | 1 + internal/service/badge/badge_event_handler.go | 1 + internal/service/badge/badge_group_service.go | 1 + internal/service/badge/badge_service.go | 3 ++- internal/service/content/question_hottest_service.go | 5 +++-- internal/service/content/vote_service.go | 3 ++- internal/service/export/email_service.go | 3 ++- internal/service/meta/meta_service.go | 3 ++- internal/service/notification/notification_service.go | 1 + internal/service/permission/answer_permission.go | 1 + internal/service/permission/question_permission.go | 1 + internal/service/provider.go | 2 +- internal/service/report/report_service.go | 1 + internal/service/search_parser/search_parser.go | 3 ++- .../user_notification_config/user_notification_config_service.go | 1 + pkg/converter/str.go | 3 ++- pkg/day/day_test.go | 3 ++- pkg/gravatar/gravatar_test.go | 3 ++- 60 files changed, 82 insertions(+), 25 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index af00efc3..263f63f7 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,6 +22,7 @@ linters: formatters: enable: - gofmt + - goimports settings: gofmt: simplify: true diff --git a/internal/base/handler/handler.go b/internal/base/handler/handler.go index 5a4961a3..b545b5e0 100644 --- a/internal/base/handler/handler.go +++ b/internal/base/handler/handler.go @@ -21,13 +21,14 @@ package handler import ( "errors" + "net/http" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/reason" "github.com/apache/answer/internal/base/validator" "github.com/gin-gonic/gin" myErrors "github.com/segmentfault/pacman/errors" "github.com/segmentfault/pacman/log" - "net/http" ) // HandleResponse Handle response body diff --git a/internal/base/middleware/accept_language.go b/internal/base/middleware/accept_language.go index 7a8ee391..ca8a1f90 100644 --- a/internal/base/middleware/accept_language.go +++ b/internal/base/middleware/accept_language.go @@ -20,13 +20,14 @@ package middleware import ( + "strings" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/translator" "github.com/gin-gonic/gin" "github.com/segmentfault/pacman/i18n" "golang.org/x/text/language" - "strings" ) // ExtractAndSetAcceptLanguage extract accept language from header and set to context diff --git a/internal/base/middleware/rate_limit.go b/internal/base/middleware/rate_limit.go index 29b96175..d376a6d5 100644 --- a/internal/base/middleware/rate_limit.go +++ b/internal/base/middleware/rate_limit.go @@ -22,6 +22,7 @@ package middleware import ( "encoding/json" "fmt" + "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/reason" "github.com/apache/answer/internal/repo/limit" diff --git a/internal/cli/config.go b/internal/cli/config.go index 93cb8eab..ecb62a13 100644 --- a/internal/cli/config.go +++ b/internal/cli/config.go @@ -23,6 +23,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/entity" diff --git a/internal/cli/i18n.go b/internal/cli/i18n.go index faef0f28..819ebd75 100644 --- a/internal/cli/i18n.go +++ b/internal/cli/i18n.go @@ -21,13 +21,14 @@ package cli import ( "fmt" + "os" + "path/filepath" + "strings" + "github.com/apache/answer/i18n" "github.com/apache/answer/pkg/dir" "github.com/apache/answer/pkg/writer" "gopkg.in/yaml.v3" - "os" - "path/filepath" - "strings" ) type YamlPluginContent struct { diff --git a/internal/controller/template_render/comment.go b/internal/controller/template_render/comment.go index 67efd212..2862ad8d 100644 --- a/internal/controller/template_render/comment.go +++ b/internal/controller/template_render/comment.go @@ -21,6 +21,7 @@ package templaterender import ( "context" + "github.com/apache/answer/internal/base/pager" "github.com/apache/answer/internal/schema" ) diff --git a/internal/controller/user_plugin_controller.go b/internal/controller/user_plugin_controller.go index 31021525..1c4c041c 100644 --- a/internal/controller/user_plugin_controller.go +++ b/internal/controller/user_plugin_controller.go @@ -21,10 +21,11 @@ package controller import ( "encoding/json" + "net/http" + "github.com/apache/answer/internal/base/middleware" "github.com/apache/answer/internal/base/reason" "github.com/segmentfault/pacman/errors" - "net/http" "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/schema" diff --git a/internal/entity/badge_entity.go b/internal/entity/badge_entity.go index a370e275..367bb745 100644 --- a/internal/entity/badge_entity.go +++ b/internal/entity/badge_entity.go @@ -20,8 +20,9 @@ package entity import ( - "github.com/tidwall/gjson" "time" + + "github.com/tidwall/gjson" ) type BadgeLevel int diff --git a/internal/entity/config_entity.go b/internal/entity/config_entity.go index 95a02be4..d39af7b2 100644 --- a/internal/entity/config_entity.go +++ b/internal/entity/config_entity.go @@ -21,6 +21,7 @@ package entity import ( "encoding/json" + "github.com/segmentfault/pacman/log" "github.com/apache/answer/pkg/converter" diff --git a/internal/migrations/v1.go b/internal/migrations/v1.go index c5e731a0..688732fa 100644 --- a/internal/migrations/v1.go +++ b/internal/migrations/v1.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "xorm.io/xorm" ) diff --git a/internal/migrations/v13.go b/internal/migrations/v13.go index 30bfbb54..57d24848 100644 --- a/internal/migrations/v13.go +++ b/internal/migrations/v13.go @@ -24,6 +24,7 @@ import ( "encoding/json" "fmt" "time" + "xorm.io/builder" "github.com/apache/answer/internal/base/constant" diff --git a/internal/migrations/v14.go b/internal/migrations/v14.go index ee3a3d0d..5e125c98 100644 --- a/internal/migrations/v14.go +++ b/internal/migrations/v14.go @@ -22,6 +22,7 @@ package migrations import ( "context" "time" + "xorm.io/xorm/schemas" "xorm.io/xorm" diff --git a/internal/migrations/v15.go b/internal/migrations/v15.go index 5195c105..5858d009 100644 --- a/internal/migrations/v15.go +++ b/internal/migrations/v15.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "github.com/apache/answer/internal/entity" "xorm.io/xorm" ) diff --git a/internal/migrations/v16.go b/internal/migrations/v16.go index 11643600..11ae3684 100644 --- a/internal/migrations/v16.go +++ b/internal/migrations/v16.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/entity" "github.com/segmentfault/pacman/log" diff --git a/internal/migrations/v17.go b/internal/migrations/v17.go index 655e547a..3fa2c7b3 100644 --- a/internal/migrations/v17.go +++ b/internal/migrations/v17.go @@ -22,6 +22,7 @@ package migrations import ( "context" "fmt" + "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/service/permission" "github.com/segmentfault/pacman/log" diff --git a/internal/migrations/v18.go b/internal/migrations/v18.go index 89db524f..7178c704 100644 --- a/internal/migrations/v18.go +++ b/internal/migrations/v18.go @@ -23,6 +23,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/schema" diff --git a/internal/migrations/v19.go b/internal/migrations/v19.go index b45d374b..b50c89f1 100644 --- a/internal/migrations/v19.go +++ b/internal/migrations/v19.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "github.com/apache/answer/internal/entity" "xorm.io/xorm" ) diff --git a/internal/migrations/v2.go b/internal/migrations/v2.go index 4e17597d..601ff98b 100644 --- a/internal/migrations/v2.go +++ b/internal/migrations/v2.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "xorm.io/xorm" ) diff --git a/internal/migrations/v21.go b/internal/migrations/v21.go index 880852f8..de38bffb 100644 --- a/internal/migrations/v21.go +++ b/internal/migrations/v21.go @@ -21,6 +21,7 @@ package migrations import ( "context" + "xorm.io/xorm" ) diff --git a/internal/migrations/v22.go b/internal/migrations/v22.go index 14292a1e..e7177dea 100644 --- a/internal/migrations/v22.go +++ b/internal/migrations/v22.go @@ -22,6 +22,7 @@ package migrations import ( "context" "fmt" + "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/repo/unique" diff --git a/internal/migrations/v24.go b/internal/migrations/v24.go index 19358af4..a488679f 100644 --- a/internal/migrations/v24.go +++ b/internal/migrations/v24.go @@ -23,6 +23,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/schema" diff --git a/internal/repo/activity/answer_repo.go b/internal/repo/activity/answer_repo.go index db6e3bde..4aca874a 100644 --- a/internal/repo/activity/answer_repo.go +++ b/internal/repo/activity/answer_repo.go @@ -22,8 +22,9 @@ package activity import ( "context" "fmt" - "github.com/segmentfault/pacman/log" "time" + + "github.com/segmentfault/pacman/log" "xorm.io/builder" "github.com/apache/answer/internal/base/constant" diff --git a/internal/repo/activity/user_active_repo.go b/internal/repo/activity/user_active_repo.go index 2452bcf8..68dfec7d 100644 --- a/internal/repo/activity/user_active_repo.go +++ b/internal/repo/activity/user_active_repo.go @@ -22,6 +22,7 @@ package activity import ( "context" "fmt" + "xorm.io/builder" "github.com/apache/answer/internal/base/data" diff --git a/internal/repo/activity_common/vote.go b/internal/repo/activity_common/vote.go index cb7d23d0..50657842 100644 --- a/internal/repo/activity_common/vote.go +++ b/internal/repo/activity_common/vote.go @@ -21,6 +21,7 @@ package activity_common import ( "context" + "github.com/apache/answer/pkg/uid" "github.com/apache/answer/internal/base/data" diff --git a/internal/repo/auth/auth.go b/internal/repo/auth/auth.go index a1e358f9..597352b2 100644 --- a/internal/repo/auth/auth.go +++ b/internal/repo/auth/auth.go @@ -22,6 +22,7 @@ package auth import ( "context" "encoding/json" + "github.com/apache/answer/internal/service/auth" "github.com/apache/answer/internal/base/constant" diff --git a/internal/repo/badge/badge_event_rule.go b/internal/repo/badge/badge_event_rule.go index 8c4656db..786d988a 100644 --- a/internal/repo/badge/badge_event_rule.go +++ b/internal/repo/badge/badge_event_rule.go @@ -21,6 +21,8 @@ package badge import ( "context" + "strconv" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/reason" @@ -29,7 +31,6 @@ import ( "github.com/apache/answer/internal/service/badge" "github.com/segmentfault/pacman/errors" "github.com/segmentfault/pacman/log" - "strconv" ) // eventRuleRepo event rule repo diff --git a/internal/repo/badge/badge_repo.go b/internal/repo/badge/badge_repo.go index 257caef8..baff45d8 100644 --- a/internal/repo/badge/badge_repo.go +++ b/internal/repo/badge/badge_repo.go @@ -21,6 +21,7 @@ package badge import ( "context" + "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/pager" "github.com/apache/answer/internal/base/reason" diff --git a/internal/repo/badge_award/badge_award_repo.go b/internal/repo/badge_award/badge_award_repo.go index eda5d80c..11429e57 100644 --- a/internal/repo/badge_award/badge_award_repo.go +++ b/internal/repo/badge_award/badge_award_repo.go @@ -22,6 +22,7 @@ package badge_award import ( "context" "fmt" + "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/pager" "github.com/apache/answer/internal/base/reason" diff --git a/internal/repo/badge_group/badge_group_repo.go b/internal/repo/badge_group/badge_group_repo.go index 839ba469..8f1111a4 100644 --- a/internal/repo/badge_group/badge_group_repo.go +++ b/internal/repo/badge_group/badge_group_repo.go @@ -21,6 +21,7 @@ package badge_group import ( "context" + "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/service/badge" diff --git a/internal/repo/collection/collection_repo.go b/internal/repo/collection/collection_repo.go index a3faacdb..f30692c9 100644 --- a/internal/repo/collection/collection_repo.go +++ b/internal/repo/collection/collection_repo.go @@ -21,6 +21,7 @@ package collection import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/handler" diff --git a/internal/repo/export/email_repo.go b/internal/repo/export/email_repo.go index 1f8e1ce8..a3e61971 100644 --- a/internal/repo/export/email_repo.go +++ b/internal/repo/export/email_repo.go @@ -21,9 +21,10 @@ package export import ( "context" + "time" + "github.com/apache/answer/internal/base/constant" "github.com/tidwall/gjson" - "time" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/reason" diff --git a/internal/repo/limit/limit.go b/internal/repo/limit/limit.go index 4868accd..524ad12b 100644 --- a/internal/repo/limit/limit.go +++ b/internal/repo/limit/limit.go @@ -22,11 +22,12 @@ package limit import ( "context" "fmt" + "time" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/reason" "github.com/segmentfault/pacman/errors" - "time" ) // LimitRepo auth repository diff --git a/internal/repo/meta/meta_repo.go b/internal/repo/meta/meta_repo.go index 9680fb41..fecd7bd5 100644 --- a/internal/repo/meta/meta_repo.go +++ b/internal/repo/meta/meta_repo.go @@ -25,7 +25,7 @@ import ( "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/reason" "github.com/apache/answer/internal/entity" - "github.com/apache/answer/internal/service/meta_common" + metacommon "github.com/apache/answer/internal/service/meta_common" "github.com/segmentfault/pacman/errors" "xorm.io/builder" "xorm.io/xorm" diff --git a/internal/repo/plugin_config/plugin_user_config_repo.go b/internal/repo/plugin_config/plugin_user_config_repo.go index 83da8e75..d14442a5 100644 --- a/internal/repo/plugin_config/plugin_user_config_repo.go +++ b/internal/repo/plugin_config/plugin_user_config_repo.go @@ -21,6 +21,7 @@ package plugin_config import ( "context" + "github.com/apache/answer/internal/base/pager" "xorm.io/xorm" diff --git a/internal/repo/search_sync/search_sync.go b/internal/repo/search_sync/search_sync.go index 5c0adc0f..889ffe5b 100644 --- a/internal/repo/search_sync/search_sync.go +++ b/internal/repo/search_sync/search_sync.go @@ -21,6 +21,7 @@ package search_sync import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/entity" diff --git a/internal/repo/user_notification_config/user_notification_config_repo.go b/internal/repo/user_notification_config/user_notification_config_repo.go index 8ea2b065..0e761514 100644 --- a/internal/repo/user_notification_config/user_notification_config_repo.go +++ b/internal/repo/user_notification_config/user_notification_config_repo.go @@ -21,6 +21,7 @@ package user_notification_config import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/reason" diff --git a/internal/schema/email_template.go b/internal/schema/email_template.go index 1fcdfbce..d7e4b929 100644 --- a/internal/schema/email_template.go +++ b/internal/schema/email_template.go @@ -21,6 +21,7 @@ package schema import ( "encoding/json" + "github.com/apache/answer/internal/base/constant" ) diff --git a/internal/schema/notification_schema.go b/internal/schema/notification_schema.go index a68328ac..e5d60615 100644 --- a/internal/schema/notification_schema.go +++ b/internal/schema/notification_schema.go @@ -21,8 +21,9 @@ package schema import ( "encoding/json" - "github.com/apache/answer/internal/entity" "sort" + + "github.com/apache/answer/internal/entity" ) const ( diff --git a/internal/schema/user_notification_schema.go b/internal/schema/user_notification_schema.go index eca97e81..60cc4a27 100644 --- a/internal/schema/user_notification_schema.go +++ b/internal/schema/user_notification_schema.go @@ -21,6 +21,7 @@ package schema import ( "encoding/json" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/entity" ) diff --git a/internal/service/activity/activity.go b/internal/service/activity/activity.go index 2d384f34..061d8449 100644 --- a/internal/service/activity/activity.go +++ b/internal/service/activity/activity.go @@ -26,7 +26,7 @@ import ( "strings" "github.com/apache/answer/internal/service/activity_common" - "github.com/apache/answer/internal/service/meta_common" + metacommon "github.com/apache/answer/internal/service/meta_common" "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/handler" diff --git a/internal/service/activity/answer_activity_service.go b/internal/service/activity/answer_activity_service.go index 169e7eb3..48b5f3ef 100644 --- a/internal/service/activity/answer_activity_service.go +++ b/internal/service/activity/answer_activity_service.go @@ -21,6 +21,7 @@ package activity import ( "context" + "github.com/apache/answer/internal/schema" "github.com/apache/answer/internal/service/activity_type" "github.com/apache/answer/internal/service/config" diff --git a/internal/service/badge/badge_award_service.go b/internal/service/badge/badge_award_service.go index 397a7471..982c1d1a 100644 --- a/internal/service/badge/badge_award_service.go +++ b/internal/service/badge/badge_award_service.go @@ -21,6 +21,7 @@ package badge import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/reason" diff --git a/internal/service/badge/badge_event_handler.go b/internal/service/badge/badge_event_handler.go index 21982294..cc161f6a 100644 --- a/internal/service/badge/badge_event_handler.go +++ b/internal/service/badge/badge_event_handler.go @@ -21,6 +21,7 @@ package badge import ( "context" + "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/schema" diff --git a/internal/service/badge/badge_group_service.go b/internal/service/badge/badge_group_service.go index e0dab6e8..7c220a0b 100644 --- a/internal/service/badge/badge_group_service.go +++ b/internal/service/badge/badge_group_service.go @@ -21,6 +21,7 @@ package badge import ( "context" + "github.com/apache/answer/internal/entity" ) diff --git a/internal/service/badge/badge_service.go b/internal/service/badge/badge_service.go index 7bc9ffe2..03b8a877 100644 --- a/internal/service/badge/badge_service.go +++ b/internal/service/badge/badge_service.go @@ -21,6 +21,8 @@ package badge import ( "context" + "strings" + "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/reason" "github.com/apache/answer/internal/base/translator" @@ -32,7 +34,6 @@ import ( "github.com/gin-gonic/gin" "github.com/segmentfault/pacman/errors" "github.com/segmentfault/pacman/log" - "strings" ) type BadgeRepo interface { diff --git a/internal/service/content/question_hottest_service.go b/internal/service/content/question_hottest_service.go index a33b155f..085b3670 100644 --- a/internal/service/content/question_hottest_service.go +++ b/internal/service/content/question_hottest_service.go @@ -21,11 +21,12 @@ package content import ( "context" + "math" + "time" + "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/schema" "github.com/segmentfault/pacman/log" - "math" - "time" ) func (q *QuestionService) RefreshHottestCron(ctx context.Context) { diff --git a/internal/service/content/vote_service.go b/internal/service/content/vote_service.go index ff3ee597..92f0c996 100644 --- a/internal/service/content/vote_service.go +++ b/internal/service/content/vote_service.go @@ -22,9 +22,10 @@ package content import ( "context" "fmt" - "github.com/apache/answer/internal/service/event_queue" "strings" + "github.com/apache/answer/internal/service/event_queue" + "github.com/apache/answer/internal/service/activity_common" "github.com/apache/answer/internal/base/constant" diff --git a/internal/service/export/email_service.go b/internal/service/export/email_service.go index b00ee093..ddf31b34 100644 --- a/internal/service/export/email_service.go +++ b/internal/service/export/email_service.go @@ -23,12 +23,13 @@ import ( "crypto/tls" "encoding/json" "fmt" - "github.com/apache/answer/pkg/display" "mime" "os" "strings" "time" + "github.com/apache/answer/pkg/display" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/reason" diff --git a/internal/service/meta/meta_service.go b/internal/service/meta/meta_service.go index 9e4f0741..4b310419 100644 --- a/internal/service/meta/meta_service.go +++ b/internal/service/meta/meta_service.go @@ -23,10 +23,11 @@ import ( "context" "encoding/json" "errors" - "github.com/apache/answer/internal/service/event_queue" "strconv" "strings" + "github.com/apache/answer/internal/service/event_queue" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/handler" "github.com/apache/answer/internal/base/reason" diff --git a/internal/service/notification/notification_service.go b/internal/service/notification/notification_service.go index 598212aa..09d87135 100644 --- a/internal/service/notification/notification_service.go +++ b/internal/service/notification/notification_service.go @@ -23,6 +23,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/base/data" "github.com/apache/answer/internal/base/handler" diff --git a/internal/service/permission/answer_permission.go b/internal/service/permission/answer_permission.go index 4eb563a5..340fca8d 100644 --- a/internal/service/permission/answer_permission.go +++ b/internal/service/permission/answer_permission.go @@ -21,6 +21,7 @@ package permission import ( "context" + "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/base/handler" diff --git a/internal/service/permission/question_permission.go b/internal/service/permission/question_permission.go index b6750bea..eca0a58f 100644 --- a/internal/service/permission/question_permission.go +++ b/internal/service/permission/question_permission.go @@ -21,6 +21,7 @@ package permission import ( "context" + "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/base/handler" diff --git a/internal/service/provider.go b/internal/service/provider.go index 4b1b6427..65535f41 100644 --- a/internal/service/provider.go +++ b/internal/service/provider.go @@ -40,7 +40,7 @@ import ( "github.com/apache/answer/internal/service/follow" "github.com/apache/answer/internal/service/importer" "github.com/apache/answer/internal/service/meta" - "github.com/apache/answer/internal/service/meta_common" + metacommon "github.com/apache/answer/internal/service/meta_common" "github.com/apache/answer/internal/service/notice_queue" "github.com/apache/answer/internal/service/notification" notficationcommon "github.com/apache/answer/internal/service/notification_common" diff --git a/internal/service/report/report_service.go b/internal/service/report/report_service.go index 7dcc1d68..d32ccdab 100644 --- a/internal/service/report/report_service.go +++ b/internal/service/report/report_service.go @@ -21,6 +21,7 @@ package report import ( "encoding/json" + "github.com/apache/answer/internal/service/event_queue" "github.com/apache/answer/internal/base/constant" diff --git a/internal/service/search_parser/search_parser.go b/internal/service/search_parser/search_parser.go index e87efaf6..3e6182e1 100644 --- a/internal/service/search_parser/search_parser.go +++ b/internal/service/search_parser/search_parser.go @@ -22,10 +22,11 @@ package search_parser import ( "context" "fmt" - "github.com/apache/answer/internal/base/constant" "regexp" "strings" + "github.com/apache/answer/internal/base/constant" + "github.com/apache/answer/internal/schema" "github.com/apache/answer/internal/service/tag_common" usercommon "github.com/apache/answer/internal/service/user_common" diff --git a/internal/service/user_notification_config/user_notification_config_service.go b/internal/service/user_notification_config/user_notification_config_service.go index 7c54df0a..01da3ee2 100644 --- a/internal/service/user_notification_config/user_notification_config_service.go +++ b/internal/service/user_notification_config/user_notification_config_service.go @@ -21,6 +21,7 @@ package user_notification_config import ( "context" + "github.com/apache/answer/internal/base/constant" "github.com/apache/answer/internal/entity" "github.com/apache/answer/internal/schema" diff --git a/pkg/converter/str.go b/pkg/converter/str.go index 5164609c..8553975b 100644 --- a/pkg/converter/str.go +++ b/pkg/converter/str.go @@ -21,8 +21,9 @@ package converter import ( "fmt" - "github.com/segmentfault/pacman/log" "strconv" + + "github.com/segmentfault/pacman/log" ) func StringToInt64(str string) int64 { diff --git a/pkg/day/day_test.go b/pkg/day/day_test.go index 73e49aca..4f945d88 100644 --- a/pkg/day/day_test.go +++ b/pkg/day/day_test.go @@ -20,9 +20,10 @@ package day import ( - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/stretchr/testify/assert" ) func TestFormat(t *testing.T) { diff --git a/pkg/gravatar/gravatar_test.go b/pkg/gravatar/gravatar_test.go index bf504e68..b88a6964 100644 --- a/pkg/gravatar/gravatar_test.go +++ b/pkg/gravatar/gravatar_test.go @@ -20,9 +20,10 @@ package gravatar import ( - "github.com/apache/answer/internal/base/constant" "testing" + "github.com/apache/answer/internal/base/constant" + "github.com/stretchr/testify/assert" )
