Skip to content

Commit

Permalink
chore(gomall): lint fix
Browse files Browse the repository at this point in the history
Signed-off-by: rogerogers <[email protected]>
  • Loading branch information
rogerogers committed Apr 28, 2024
1 parent 0b3b738 commit 0c47c7f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gomall/tutorial/ch07/demo/demo_proto/biz/dal/mysql/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ func Init() {
if err != nil {
panic(err)
}
DB.AutoMigrate(model.User{})
DB.AutoMigrate(model.User{}) //nolint: errcheck
fmt.Printf("%#v", DB.Debug().Exec("select version()"))
}
6 changes: 2 additions & 4 deletions gomall/tutorial/ch07/demo/demo_proto/biz/dal/redis/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ package redis
import (
"context"

"github.com/redis/go-redis/v9"
"github.com/cloudwego/biz-demo/gomall/demo/demo_proto/conf"
"github.com/redis/go-redis/v9"
)

var (
RedisClient *redis.Client
)
var RedisClient *redis.Client

func Init() {
RedisClient = redis.NewClient(&redis.Options{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package service
import (
"context"
"testing"

pbapi "github.com/cloudwego/biz-demo/gomall/demo/demo_proto/kitex_gen/pbapi"
)

Expand All @@ -31,5 +32,4 @@ func TestEcho_Run(t *testing.T) {
t.Logf("resp: %v", resp)

// todo: edit your unit test

}
4 changes: 1 addition & 3 deletions gomall/tutorial/ch07/demo/demo_thrift/biz/dal/redis/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (
"github.com/redis/go-redis/v9"
)

var (
RedisClient *redis.Client
)
var RedisClient *redis.Client

func Init() {
RedisClient = redis.NewClient(&redis.Options{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ package service

import (
"context"
api "github.com/cloudwego/biz-demo/gomall/demo/demo_thrift/kitex_gen/api"
"testing"

api "github.com/cloudwego/biz-demo/gomall/demo/demo_thrift/kitex_gen/api"
)

func TestEcho_Run(t *testing.T) {
Expand All @@ -31,5 +32,4 @@ func TestEcho_Run(t *testing.T) {
t.Logf("resp: %v", resp)

// todo: edit your unit test

}
3 changes: 1 addition & 2 deletions gomall/tutorial/ch07/demo/demo_thrift/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package conf

import (
"io/ioutil"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -78,7 +77,7 @@ func GetConf() *Config {
func initConf() {
prefix := "conf"
confFileRelPath := filepath.Join(prefix, filepath.Join(GetEnv(), "conf.yaml"))
content, err := ioutil.ReadFile(confFileRelPath)
content, err := os.ReadFile(confFileRelPath)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion gomall/tutorial/ch07/demo/demo_thrift/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func kitexInit() (opts []server.Option) {
}
klog.SetOutput(asyncWriter)
server.RegisterShutdownHook(func() {
_ = asyncWriter.Sync()
_ = asyncWriter.Sync()
})
return
}

0 comments on commit 0c47c7f

Please sign in to comment.