ci: add linter

This commit is contained in:
2026-01-03 17:57:11 +08:00
parent a6a83f8d9f
commit a8b3a34db7
5 changed files with 65 additions and 8 deletions

View File

@@ -1,16 +1,16 @@
package hello
import (
"testing"
"net/http/httptest"
"testing"
)
func TestHelloHandler(t *testing.T) {
w := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/hello", nil)
HelloHandler(w, req)
Handler(w, req)
expected := "Hello, World!"
if w.Body.String() != expected {
t.Errorf("Expected %q but got %q", expected, w.Body.String())
}
}
}