diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0dec0026..376d2269 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,6 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} - goversion: "https://go.dev/dl/go1.18.3.linux-amd64.tar.gz" + goversion: "https://go.dev/dl/go1.20.11.linux-amd64.tar.gz" project_path: "./cmd/arana" binary_name: "arana" diff --git a/cmd/start.go b/cmd/start.go index 7fa5da8a..7d32e672 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -92,7 +92,7 @@ func Start(bootstrapConfigPath string) { discovery := boot.NewDiscovery(bootstrapConfigPath) if err := boot.Boot(context.Background(), discovery); err != nil { - log.Fatal("start failed: %v", err) + log.Fatalf("start failed: %v", err) return } diff --git a/pkg/config/api_test.go b/pkg/config/api_test.go index e044634d..52f0ea77 100644 --- a/pkg/config/api_test.go +++ b/pkg/config/api_test.go @@ -47,6 +47,7 @@ func TestInit(t *testing.T) { wantErr assert.ErrorAssertionFunc }{ {"Init_1", args{"file", config.Options{}}, assert.Error}, + {"Init_2", args{"", config.Options{}}, assert.NoError}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -105,7 +106,8 @@ func Test_Init(t *testing.T) { err := config.InitStoreOperate(options) assert.Error(t, err) - config.Register(mockFileStore) + err = config.Register(mockFileStore) + assert.NoError(t, err) err = config.InitStoreOperate(options) assert.NoError(t, err) diff --git a/pkg/config/file/file_test.go b/pkg/config/file/file_test.go index e71a4f9d..6c86bff0 100644 --- a/pkg/config/file/file_test.go +++ b/pkg/config/file/file_test.go @@ -24,6 +24,7 @@ import ( ) import ( + "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" ) @@ -388,9 +389,9 @@ func Test_storeOperate_initContentsMap(t *testing.T) { contents: tt.fields.contents, } - s.Init(map[string]interface{}{ + assert.NoError(t, s.Init(map[string]interface{}{ "content": yamlConfig, - }) + })) cfg := new(config.Configuration) _ = yaml.Unmarshal([]byte(tt.args.val), cfg)