MCPcopy Index your code
hub / github.com/labstack/echo / TestBindingError_ErrorJSON

Function TestBindingError_ErrorJSON

binder_test.go:57–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestBindingError_ErrorJSON(t *testing.T) {
58 err := NewBindingError("id", []string{"1", "nope"}, "bind failed", errors.New("internal error"))
59
60 resp, _ := json.Marshal(err)
61
62 assert.Equal(t, `{"field":"id","message":"bind failed"}`, string(resp))
63}
64
65func TestPathValuesBinder(t *testing.T) {
66 c := createTestContext("/api/user/999", nil, map[string]string{

Callers

nothing calls this directly

Calls 1

NewBindingErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…