Skip to content

Commit 11f888d

Browse files
authored
chore: make format golines (#135)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 4083cae commit 11f888d

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

api/api_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ func TestHTTPClientTimeout(t *testing.T) {
1717
})
1818

1919
// Create a test server that introduces a delay
20-
testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
21-
time.Sleep(200 * time.Millisecond) // Delay longer than client timeout
22-
w.WriteHeader(http.StatusOK)
23-
}))
20+
testServer := httptest.NewServer(
21+
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
22+
time.Sleep(
23+
200 * time.Millisecond,
24+
) // Delay longer than client timeout
25+
w.WriteHeader(http.StatusOK)
26+
}),
27+
)
2428
defer testServer.Close()
2529

2630
// Make a request to the test server
@@ -43,10 +47,14 @@ func TestHTTPClientTimeoutPass(t *testing.T) {
4347
})
4448

4549
// Create a test server that introduces a delay
46-
testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
47-
time.Sleep(200 * time.Millisecond) // Delay shorter than client timeout
48-
w.WriteHeader(http.StatusOK)
49-
}))
50+
testServer := httptest.NewServer(
51+
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
52+
time.Sleep(
53+
200 * time.Millisecond,
54+
) // Delay shorter than client timeout
55+
w.WriteHeader(http.StatusOK)
56+
}),
57+
)
5058
defer testServer.Close()
5159

5260
// Make a request to the test server

config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ type LoggingConfig struct {
3333
}
3434

3535
type ApiConfig struct {
36-
ListenAddress string `yaml:"address" envconfig:"API_LISTEN_ADDRESS"`
37-
ListenPort uint `yaml:"port" envconfig:"API_LISTEN_PORT"`
38-
ClientTimeout uint `yaml:"client_timeout" envconfig:"CLIENT_TIMEOUT"`
36+
ListenAddress string `yaml:"address" envconfig:"API_LISTEN_ADDRESS"`
37+
ListenPort uint `yaml:"port" envconfig:"API_LISTEN_PORT"`
38+
ClientTimeout uint `yaml:"client_timeout" envconfig:"CLIENT_TIMEOUT"`
3939
}
4040

4141
// Singleton config instance with default values

0 commit comments

Comments
 (0)