✏️ Fix: typos (#2127)

Fix: typos
pull/2128/head
Fufu 2022-09-28 13:55:28 +08:00 committed by GitHub
parent ff348b5e92
commit 4108d73fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,6 @@ func main() {
func sleepWithContext(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():
if !timer.Stop() {
@ -80,11 +79,11 @@ func main() {
return nil
}
app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second), ErrFooTimeOut)
app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second, ErrFooTimeOut))
_ = app.Listen(":3000")
}
func sleepWithContext(ctx context.Context, d time.Duration) error {
func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():