Skip to content

Commit 62e765f

Browse files
committed
refactor(goimports): add goimports to golangci-lint configuration #1432
1 parent 74654f2 commit 62e765f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+82
-25
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
formatters:
2323
enable:
2424
- gofmt
25+
- goimports
2526
settings:
2627
gofmt:
2728
simplify: true

internal/base/handler/handler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ package handler
2121

2222
import (
2323
"errors"
24+
"net/http"
25+
2426
"github.com/apache/answer/internal/base/constant"
2527
"github.com/apache/answer/internal/base/reason"
2628
"github.com/apache/answer/internal/base/validator"
2729
"github.com/gin-gonic/gin"
2830
myErrors "github.com/segmentfault/pacman/errors"
2931
"github.com/segmentfault/pacman/log"
30-
"net/http"
3132
)
3233

3334
// HandleResponse Handle response body

internal/base/middleware/accept_language.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
package middleware
2121

2222
import (
23+
"strings"
24+
2325
"github.com/apache/answer/internal/base/constant"
2426
"github.com/apache/answer/internal/base/handler"
2527
"github.com/apache/answer/internal/base/translator"
2628
"github.com/gin-gonic/gin"
2729
"github.com/segmentfault/pacman/i18n"
2830
"golang.org/x/text/language"
29-
"strings"
3031
)
3132

3233
// ExtractAndSetAcceptLanguage extract accept language from header and set to context

internal/base/middleware/rate_limit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package middleware
2222
import (
2323
"encoding/json"
2424
"fmt"
25+
2526
"github.com/apache/answer/internal/base/handler"
2627
"github.com/apache/answer/internal/base/reason"
2728
"github.com/apache/answer/internal/repo/limit"

internal/cli/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"context"
2424
"encoding/json"
2525
"fmt"
26+
2627
"github.com/apache/answer/internal/base/constant"
2728
"github.com/apache/answer/internal/base/data"
2829
"github.com/apache/answer/internal/entity"

internal/cli/i18n.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ package cli
2121

2222
import (
2323
"fmt"
24+
"os"
25+
"path/filepath"
26+
"strings"
27+
2428
"github.com/apache/answer/i18n"
2529
"github.com/apache/answer/pkg/dir"
2630
"github.com/apache/answer/pkg/writer"
2731
"gopkg.in/yaml.v3"
28-
"os"
29-
"path/filepath"
30-
"strings"
3132
)
3233

3334
type YamlPluginContent struct {

internal/controller/template_render/comment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package templaterender
2121

2222
import (
2323
"context"
24+
2425
"github.com/apache/answer/internal/base/pager"
2526
"github.com/apache/answer/internal/schema"
2627
)

internal/controller/user_plugin_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ package controller
2121

2222
import (
2323
"encoding/json"
24+
"net/http"
25+
2426
"github.com/apache/answer/internal/base/middleware"
2527
"github.com/apache/answer/internal/base/reason"
2628
"github.com/segmentfault/pacman/errors"
27-
"net/http"
2829

2930
"github.com/apache/answer/internal/base/handler"
3031
"github.com/apache/answer/internal/schema"

internal/entity/badge_entity.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
package entity
2121

2222
import (
23-
"github.com/tidwall/gjson"
2423
"time"
24+
25+
"github.com/tidwall/gjson"
2526
)
2627

2728
type BadgeLevel int

internal/entity/config_entity.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package entity
2121

2222
import (
2323
"encoding/json"
24+
2425
"github.com/segmentfault/pacman/log"
2526

2627
"github.com/apache/answer/pkg/converter"

0 commit comments

Comments
 (0)