Skip to content

Commit

Permalink
Merge pull request justmao945#12 from CodeLingoBot/rewrite
Browse files Browse the repository at this point in the history
Fix function comments based on best practices from Effective Go
  • Loading branch information
justmao945 committed Mar 7, 2019
2 parents 3816fcc + 3277d27 commit cad1a47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
)

// return host if has port in addr, or addr if missing port
// HostOnly returns host if has port in addr, or addr if missing port
func HostOnly(addr string) string {
host, _, err := net.SplitHostPort(addr)
if err != nil {
Expand All @@ -30,7 +30,7 @@ func CopyHeader(w http.ResponseWriter, r *http.Response) {
}
}

// Return http status text looks like "200 OK"
// StatusText returns http status text looks like "200 OK"
func StatusText(c int) string {
return fmt.Sprintf("%d %s", c, http.StatusText(c))
}
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (self *Server) Blocked(host string) bool {
return blocked
}

// HTTP proxy accepts requests with following two types:
// ServeHTTP proxy accepts requests with following two types:
// - CONNECT
// Generally, this method is used when the client want to connect server with HTTPS.
// In fact, the client can do anything he want in this CONNECT way...
Expand Down

0 comments on commit cad1a47

Please sign in to comment.