Skip to content

Commit 73d0699

Browse files
author
Sisyphus Agent
committed
fix: 检查 Init() 返回值修复 errcheck lint 错误
1 parent bdad95e commit 73d0699

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

oho/internal/config/config_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ func TestGetBaseURL(t *testing.T) {
7979
os.Unsetenv("OPENCODE_SERVER_USERNAME")
8080
os.Unsetenv("OPENCODE_SERVER_PASSWORD")
8181

82-
Init()
82+
if err := Init(); err != nil {
83+
t.Fatalf("Init() returned error: %v", err)
84+
}
8385

8486
baseURL := GetBaseURL()
8587
expected := "http://127.0.0.1:4096"
@@ -96,7 +98,9 @@ func TestGetBaseURLWithCustomHostPort(t *testing.T) {
9698
os.Unsetenv("OPENCODE_SERVER_PORT")
9799
}()
98100

99-
Init()
101+
if err := Init(); err != nil {
102+
t.Fatalf("Init() returned error: %v", err)
103+
}
100104

101105
baseURL := GetBaseURL()
102106
expected := "http://10.0.0.1:3000"

0 commit comments

Comments
 (0)