Skip to content

Commit 77d9c69

Browse files
committed
Fix: pkg/gobash/gobash_test.go:21:11: non-constant format string in call to (*testing.common).Logf
1 parent 446c784 commit 77d9c69

File tree

8 files changed

+10
-13
lines changed

8 files changed

+10
-13
lines changed

pkg/aicli/chatgpt/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestClient_SendStream(t *testing.T) {
4646
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
4747
reply := client.SendStream(ctx, "Which model did you use to answer the question?")
4848
for content := range reply.Content {
49-
fmt.Printf(content)
49+
fmt.Print(content)
5050
}
5151
if reply.Err != nil {
5252
t.Log(reply.Err)

pkg/aicli/deepseek/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestClient_SendStream(t *testing.T) {
4646
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
4747
answer := client.SendStream(ctx, genericRoleDescZH)
4848
for content := range answer.Content {
49-
fmt.Printf(content)
49+
fmt.Print(content)
5050
}
5151
if answer.Err != nil {
5252
t.Log(answer.Err)

pkg/aicli/gemini/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestClient_SendStream(t *testing.T) {
4141
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
4242
reply := client.SendStream(ctx, "Which model did you use to answer the question?")
4343
for content := range reply.Content {
44-
fmt.Printf(content)
44+
fmt.Print(content)
4545
}
4646
if reply.Err != nil {
4747
t.Log(reply.Err)

pkg/conf/parse_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ func Test_hideSensitiveFields(t *testing.T) {
2727
keywords = append(keywords, `"dsn"`, `"password"`, `"name"`)
2828
str := Show(c, keywords...)
2929

30-
fmt.Printf(hideSensitiveFields(str))
30+
fmt.Print(hideSensitiveFields(str))
3131

3232
str = "\ndefault:123456@192.168.3.37:6379/0\n"
33-
fmt.Printf(hideSensitiveFields(str))
33+
fmt.Print(hideSensitiveFields(str))
3434
}
3535

3636
// test listening for configuration file updates

pkg/gobash/gobash_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestRun(t *testing.T) {
1818
ctx, _ := context.WithTimeout(context.Background(), time.Second)
1919
result := Run(ctx, cmd, args...)
2020
for v := range result.StdOut { // Real-time output of logs and error messages
21-
t.Logf(v)
21+
t.Log(v)
2222
}
2323
if result.Err != nil {
2424
t.Logf("execute command failed, %v", result.Err)

pkg/sgorm/mysql/mysql_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package mysql
22

33
import (
4-
"fmt"
54
"testing"
65
"time"
76

@@ -13,7 +12,7 @@ func TestInitMysql(t *testing.T) {
1312
db, err := Init(dsn, WithEnableTrace())
1413
if err != nil {
1514
// ignore test error about not being able to connect to real mysql
16-
t.Logf(fmt.Sprintf("connect to mysql failed, err=%v, dsn=%s", err, dsn))
15+
t.Logf("connect to mysql failed, err=%v, dsn=%s", err, dsn)
1716
return
1817
}
1918
defer Close(db)
@@ -26,7 +25,7 @@ func TestInitTidb(t *testing.T) {
2625
db, err := InitTidb(dsn)
2726
if err != nil {
2827
// ignore test error about not being able to connect to real tidb
29-
t.Logf(fmt.Sprintf("connect to mysql failed, err=%v, dsn=%s", err, dsn))
28+
t.Logf("connect to mysql failed, err=%v, dsn=%s", err, dsn)
3029
return
3130
}
3231
defer Close(db)

pkg/sgorm/postgresql/postgresql_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package postgresql
22

33
import (
4-
"fmt"
54
"testing"
65
"time"
76

@@ -13,7 +12,7 @@ func TestInit(t *testing.T) {
1312
db, err := Init(dsn, WithEnableTrace())
1413
if err != nil {
1514
// ignore test error about not being able to connect to real postgresql
16-
t.Logf(fmt.Sprintf("connect to postgresql failed, err=%v, dsn=%s", err, dsn))
15+
t.Logf("connect to postgresql failed, err=%v, dsn=%s", err, dsn)
1716
return
1817
}
1918
defer Close(db)

pkg/sgorm/sqlite/sqlite_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package sqlite
22

33
import (
4-
"fmt"
54
"testing"
65
"time"
76

@@ -13,7 +12,7 @@ func TestInit(t *testing.T) {
1312
db, err := Init(dbFile)
1413
if err != nil {
1514
// ignore test error about not being able to connect to real sqlite
16-
t.Logf(fmt.Sprintf("connect to sqlite failed, err=%v, dbFile=%s", err, dbFile))
15+
t.Logf("connect to sqlite failed, err=%v, dbFile=%s", err, dbFile)
1716
return
1817
}
1918
defer Close(db)

0 commit comments

Comments
 (0)