-
Notifications
You must be signed in to change notification settings - Fork 1
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
rename.. #1
rename.. #1
Conversation
@mushroomsir 按照 go 源码的习惯,error 一般小写开头 |
request: req, | ||
writer: res, | ||
req: r, | ||
w: w, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w
写法改统一了,但是 req
和 r
依然有点不一样的样子
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉要不和 w
一样都统一为 r
? (http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {})
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
小伙子你 simple 了,我特意用了 req
,这样看源码方便理解。不信你看 golang 的 server 源码,都是req
, res
。另外还一个原因是 w 出现极少没关系,w 表明它是 writer,不是完整的 response,所以没用 res :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔🤔🤔
No description provided.