-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Simplify code of Add/Remove trailing slash and fix bug #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify code of Add/Remove trailing slash and fix bug #1275
Conversation
- simplify code (more informative / understanding) - assert collides with imported package name (in tests) - fix unhandled errors
Codecov Report
@@ Coverage Diff @@
## master #1275 +/- ##
=======================================
Coverage 81.78% 81.78%
=======================================
Files 26 26
Lines 1933 1933
=======================================
Hits 1581 1581
Misses 243 243
Partials 109 109
Continue to review full report at Codecov.
|
and this PR fix next error: package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
cli := new(http.Client)
req, err := http.NewRequest(http.MethodConnect, "http://localhost:8080", nil)
check(err)
data, err := httputil.DumpRequest(req, true)
check(err)
fmt.Println(string(data))
res, err := cli.Do(req)
check(err)
data, err = httputil.DumpResponse(res, true)
check(err)
fmt.Println(string(data))
}
|
I corrected the description. In addition to simplifying and understanding the code, this PR fixes bug in the runtime. Thoughts @vishr @alexaandru? |
Nice cleanup! 👍 |
cc @vishr / @alexaandru