Skip to content

Commit 54efc38

Browse files
remove some unused code (#2116)
* remove unused code
1 parent 3f5b733 commit 54efc38

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

binder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestBindingError_Error(t *testing.T) {
5454
func TestBindingError_ErrorJSON(t *testing.T) {
5555
err := NewBindingError("id", []string{"1", "nope"}, "bind failed", errors.New("internal error"))
5656

57-
resp, err := json.Marshal(err)
57+
resp, _ := json.Marshal(err)
5858

5959
assert.Equal(t, `{"field":"id","message":"bind failed"}`, string(resp))
6060
}

router_test.go

-31
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package echo
22

33
import (
4-
"fmt"
54
"net/http"
65
"net/http/httptest"
76
"strings"
@@ -2446,33 +2445,3 @@ func BenchmarkRouterGooglePlusAPIMisses(b *testing.B) {
24462445
func BenchmarkRouterParamsAndAnyAPI(b *testing.B) {
24472446
benchmarkRouterRoutes(b, paramAndAnyAPI, paramAndAnyAPIToFind)
24482447
}
2449-
2450-
func (n *node) printTree(pfx string, tail bool) {
2451-
p := prefix(tail, pfx, "└── ", "├── ")
2452-
fmt.Printf("%s%s, %p: type=%d, parent=%p, handler=%v, pnames=%v\n", p, n.prefix, n, n.kind, n.parent, n.methodHandler, n.pnames)
2453-
2454-
p = prefix(tail, pfx, " ", "│ ")
2455-
2456-
children := n.staticChildren
2457-
l := len(children)
2458-
2459-
if n.paramChild != nil {
2460-
n.paramChild.printTree(p, n.anyChild == nil && l == 0)
2461-
}
2462-
if n.anyChild != nil {
2463-
n.anyChild.printTree(p, l == 0)
2464-
}
2465-
for i := 0; i < l-1; i++ {
2466-
children[i].printTree(p, false)
2467-
}
2468-
if l > 0 {
2469-
children[l-1].printTree(p, true)
2470-
}
2471-
}
2472-
2473-
func prefix(tail bool, p, on, off string) string {
2474-
if tail {
2475-
return fmt.Sprintf("%s%s", p, on)
2476-
}
2477-
return fmt.Sprintf("%s%s", p, off)
2478-
}

0 commit comments

Comments
 (0)