refactor: guard timeout on API files (#1726)

This commit is contained in:
Kevin Wan
2022-03-31 21:39:02 +08:00
committed by GitHub
parent 321dc2d410
commit 2b9fc26c38
5 changed files with 44 additions and 31 deletions

View File

@@ -95,6 +95,13 @@ Port: 54321
}
}
func TestWithMaxBytes(t *testing.T) {
const maxBytes = 1000
var fr featuredRoutes
WithMaxBytes(maxBytes)(&fr)
assert.Equal(t, int64(maxBytes), fr.maxBytes)
}
func TestWithMiddleware(t *testing.T) {
m := make(map[string]string)
rt := router.NewRouter()