build: update build configuration to use internal metadata package and improve ldflags injection, fix defer resp.Body.Close() usage, replace os.Setenv with t.Setenv in tests, correct error message casing, and adjust Dockerfile and Makefile for cmd/reloader structure

This commit is contained in:
TheiLLeniumStudios
2025-12-28 08:47:57 +01:00
parent 841f6f3868
commit 0c40064872
10 changed files with 43 additions and 45 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ func (c *Client) Send(ctx context.Context, payload Payload) error {
if err != nil {
return fmt.Errorf("sending request: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("webhook returned status %d", resp.StatusCode)
+1 -1
View File
@@ -74,7 +74,7 @@ func TestSend_MarshalPayload(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, _ := io.ReadAll(r.Body)
json.Unmarshal(body, &receivedPayload)
_ = json.Unmarshal(body, &receivedPayload)
w.WriteHeader(http.StatusOK)
}))
defer server.Close()