Skip to content

Commit

Permalink
Merge pull request #58 from rogerogers/fix/lint
Browse files Browse the repository at this point in the history
style: lint fix
  • Loading branch information
GuangmingLuo authored Feb 28, 2024
2 parents b0b8482 + 551ea1f commit dbd791c
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }}
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ${{ matrix.workdir }}
args: --timeout 30m -E gofumpt
args: --timeout 30m -E gofumpt --go 1.21
skip-pkg-cache: true
1 change: 0 additions & 1 deletion book-shop/app/item/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func main() {
)

err = svr.Run()

if err != nil {
log.Println(err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion gomall/app/cart/biz/service/add_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (s *AddItemService) Run(req *cart.AddItemReq) (resp *cart.AddItemResp, err
ProductId: req.Item.ProductId,
Qty: uint32(req.Item.Quantity),
})

if err != nil {
return nil, kerrors.NewBizStatusError(50000, err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion gomall/app/frontend/biz/service/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (h *RegisterService) Run(req *auth.RegisterReq) (resp *common.Empty, err er
session := sessions.Default(h.RequestContext)
session.Set("user_id", res.UserId)
err = session.Save()

if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion gomall/app/frontend/infra/mtl/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func initMetric() route.CtxCallback {
}
registryInfo := &registry.Info{Addr: ip, ServiceName: "prometheus", Weight: 1}
err = r.Register(registryInfo)

if err != nil {
hlog.Error(err)
}
Expand Down
1 change: 0 additions & 1 deletion gomall/app/payment/biz/service/charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (s *ChargeService) Run(req *payment.ChargeReq) (resp *payment.ChargeResp, e
}

err = card.Validate(true)

if err != nil {
return nil, kerrors.NewBizStatusError(400, err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion gomall/app/product/biz/model/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (c CachedProductQuery) GetById(productId int) (product Product, err error)
}
return nil
}()

if err != nil {
product, err = c.productQuery.GetById(productId)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions open-payment-platform/pkg/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package auth

import (
"crypto/rand"
"encoding/hex"
"errors"
"math/rand"
)

type SignType string
Expand Down Expand Up @@ -54,6 +54,6 @@ func (a *authSM3) Verify(sign string, data map[string]interface{}) bool {

func (a *authSM3) Sign(data map[string]interface{}) string {
result := make([]byte, 10)
rand.Read(result)
rand.Read(result) //nolint:errcheck
return hex.EncodeToString(result)
}

0 comments on commit dbd791c

Please sign in to comment.