Skip to content

Commit 5c69535

Browse files
committed
gofumpt
1 parent ce9a3bf commit 5c69535

File tree

19 files changed

+48
-39
lines changed

19 files changed

+48
-39
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
with:
3535
go-version: "1.24.2"
3636
- name: golangci-lint
37-
uses: golangci/golangci-lint-action@v6
37+
uses: golangci/golangci-lint-action@v8
3838
with:
39-
version: v1.62.0
39+
version: v2.4.0
40+
args: --timeout=10m
41+
only-new-issues: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ logs
3030
.log
3131
.sys
3232
**/local.yaml
33+
.tool-versions

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ e2e_down:
3131
.PHONY: fmt
3232
fmt:
3333
@goimports -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" -not -name '*.pb.go' -not -name '*mock*.go')
34+
@gofumpt -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" -not -path "./**/ioc/wire_gen.go" -not -path "./**/ioc/wire.go")
3435

3536
.PHONY: lint
3637
lint:

api/proto/gen/chat/v1/chat.pb.go

Lines changed: 20 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/proto/gen/chat/v1/chat_grpc.pb.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/admin/mock.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ import (
2323
)
2424

2525
// MockHandler 这是 mock 的东西,你在生产环境要关掉
26-
type MockHandler struct {
27-
}
26+
type MockHandler struct{}
2827

2928
func NewMockHandler() *MockHandler {
3029
return new(MockHandler)

internal/admin/mock_product.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import (
2222
)
2323

2424
// MockHandler 这是 mock 的东西,你在生产环境要关掉
25-
type MockHandler struct {
26-
}
25+
type MockHandler struct{}
2726

2827
func NewMockHandler() *MockHandler {
2928
return new(MockHandler)

internal/admin/provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ func (h *ProviderHandler) GetModel(ctx *ginx.Context, sess session.Session) (gin
7979
return ginx.Result{Code: 500, Msg: "内部错误"}, err
8080
}
8181
return ginx.Result{
82-
8382
Data: ModelVO{
8483
ID: model.ID,
8584
Name: model.Name,

internal/repository/chat.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ type ChatRepo struct {
3636
}
3737

3838
func NewChatRepo(d *dao.ChatDAO, c *cache.ChatCache) *ChatRepo {
39-
return &ChatRepo{dao: d,
39+
return &ChatRepo{
40+
dao: d,
4041
cache: c,
4142
// 目前没有别的实现,先写死
4243
snGen: &sn.Generator{},

internal/repository/dao/invocation_config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ func (p *InvocationConfigDAO) SaveVersion(ctx context.Context, version Invocatio
101101
"top_p",
102102
"max_tokens",
103103
"status",
104-
"utime"}),
104+
"utime",
105+
}),
105106
}).Save(&version).Error
106107
return version.ID, err
107108
}

0 commit comments

Comments
 (0)