Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit e42f581

Browse files
committed
style: complete technical translation of tests and errors to English to achieve A+ score
1 parent d1a5fc0 commit e42f581

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

internal/commands/ping.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ func runPing(urls []string) error {
100100

101101
fmt.Println(t.Render())
102102

103-
fmt.Printf("\n--- Resumo ---\n")
104-
fmt.Printf("Sucessos: %d\n", successes)
105-
fmt.Printf("Falhas: %d\n", failures)
106-
fmt.Printf("Total: %d\n", len(urls))
103+
fmt.Printf("\n--- Summary ---\n")
104+
fmt.Printf("Successes: %d\n", successes)
105+
fmt.Printf("Failures: %d\n", failures)
106+
fmt.Printf("Total: %d\n", len(urls))
107107

108108
return nil
109109
}

internal/commands/ping_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ func TestPingHostConcurrently(t *testing.T) {
3434
wantStatus: 200,
3535
},
3636
{
37-
name: "Host Erro 500",
37+
name: "Host Error 500",
3838
targetURL: serverErr.URL,
3939
wantOnline: false,
4040
wantStatus: 500,
4141
},
4242
{
43-
name: "Host Inexistente / Timeout Replicado",
43+
name: "Non-existent Host / Replicated Timeout",
4444
targetURL: "http://localhost:59999", // Local port normally closed, generates connection refused quickly
4545
wantOnline: false,
4646
wantStatus: 0,
@@ -51,9 +51,9 @@ func TestPingHostConcurrently(t *testing.T) {
5151
t.Run(tt.name, func(t *testing.T) {
5252
res := pingHostConcurrently(tt.targetURL)
5353

54-
assert.Equal(t, tt.targetURL, res.url, "A URL de resposta deve ser a mesma.")
55-
assert.Equal(t, tt.wantOnline, res.online, "O status online retornado divergiu.")
56-
assert.Equal(t, tt.wantStatus, res.status, "O Http StatusCode retornado divergiu.")
54+
assert.Equal(t, tt.targetURL, res.url, "Response URL must match.")
55+
assert.Equal(t, tt.wantOnline, res.online, "Returned online status mismatch.")
56+
assert.Equal(t, tt.wantStatus, res.status, "Returned Http StatusCode mismatch.")
5757
})
5858
}
5959
}

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ func InitConfig() error {
3535
// File not found, we can ignore or set defaults
3636
return nil
3737
}
38-
return fmt.Errorf("erro ao ler config.yaml: %w", err)
38+
return fmt.Errorf("error reading config.yaml: %w", err)
3939
}
4040

4141
// Map to struct
4242
if err := viper.Unmarshal(&globalConfig); err != nil {
43-
return fmt.Errorf("erro ao mapear configuração: %w", err)
43+
return fmt.Errorf("error mapping configuration: %w", err)
4444
}
4545

4646
return nil

internal/config/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ func TestInitConfig(t *testing.T) {
2424

2525
// Test 1: File doesn't exist (should not return error, InitConfig ignores ConfigFileNotFoundError)
2626
err := InitConfig()
27-
assert.NoError(t, err, "A inicialização sem config.yaml deve ser tratada sem erro")
28-
assert.Empty(t, GetConfig().Hosts, "A lista de hosts deveria estar vazia")
27+
assert.NoError(t, err, "Initialization without config.yaml should be handled without error")
28+
assert.Empty(t, GetConfig().Hosts, "Host list should be empty")
2929

3030
// Test 2: Create valid config.yaml file
3131
configContent := []byte("hosts:\n - test.com\n - example.org")
@@ -35,7 +35,7 @@ func TestInitConfig(t *testing.T) {
3535
globalConfig = Config{}
3636

3737
err = InitConfig()
38-
assert.NoError(t, err, "Não deveria haver erro ao carregar config válido")
38+
assert.NoError(t, err, "Should not have error loading valid config")
3939

4040
conf := GetConfig()
4141
assert.Len(t, conf.Hosts, 2)

0 commit comments

Comments
 (0)