modify testifylint error

This commit is contained in:
riyuexingchen 2026-04-21 20:12:54 +08:00
parent 47de2f52db
commit 2075a1bce5
2 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ func TestLoadConfig(t *testing.T) {
func TestLoadConfigNotFound(t *testing.T) {
opt, err := LoadConfig("nonexistent.yaml")
assert.Error(t, err)
require.Error(t, err)
assert.Nil(t, opt)
}
@ -41,7 +41,7 @@ func TestLoadConfigInvalidYAML(t *testing.T) {
tmpFile.Close()
opt, err := LoadConfig(tmpFile.Name())
assert.Error(t, err)
require.Error(t, err)
assert.Nil(t, opt)
}

View File

@ -71,7 +71,7 @@ func TestLimitedListenerAtLimit(t *testing.T) {
client := &http.Client{Timeout: 500 * time.Millisecond}
_, err := client.Get(server.URL)
// Connection should be rejected
assert.Error(t, err, "expected connection to be rejected")
require.Error(t, err, "expected connection to be rejected")
// Release the blocked connections
close(block)
@ -106,7 +106,7 @@ func TestLimitedConnRelease(t *testing.T) {
// Second request should fail
client := &http.Client{Timeout: 200 * time.Millisecond}
_, err := client.Get(server.URL)
assert.Error(t, err, "expected connection to be rejected when limit reached")
require.Error(t, err, "expected connection to be rejected when limit reached")
// Release the first connection
close(block)