Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CI-CD/examples/sample-app/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// handleRoot returns a greeting message.
func handleRoot(w http.ResponseWriter, r *http.Request) {
if _, err := w.Write([]byte("Hello, GitHub Actions!")); err != nil {
if _, err := w.Write([]byte("Hello from HUNGYU")); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve root response expected by existing tests

Changing the handleRoot response body to "Hello from HUNGYU" breaks the current API contract validated by TestHandleRoot, which still expects "Hello, GitHub Actions!"; with this commit, that test will fail whenever the root handler is exercised in CI or local test runs unless the expectation and any dependent consumers are updated in the same change.

Useful? React with 👍 / 👎.

slog.Error("write response failed", "handler", "root", "error", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion CI-CD/examples/sample-app/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestHandleRoot(t *testing.T) {
t.Errorf("expected status %d, got %d", http.StatusOK, rec.Code)
}

expected := "Hello, GitHub Actions!"
expected := "Hello, from HUNGYU!"
if rec.Body.String() != expected {
t.Errorf("expected body %q, got %q", expected, rec.Body.String())
}
Expand Down