Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commit647cf55

Browse files
authored
Simplify removeEmptyPort function implementation
1 parent2eb154b commit647cf55

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/net/http/http.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastInd
113113
// removeEmptyPort strips the empty port in ":port" to ""
114114
// as mandated by RFC 3986 Section 6.2.3.
115115
funcremoveEmptyPort(hoststring)string {
116-
host,_=strings.CutSuffix(host,":")
117-
returnhost
116+
returnstrings.TrimSuffix(host,":")
118117
}
119118

120119
// isToken reports whether v is a valid token (https://www.rfc-editor.org/rfc/rfc2616#section-2.2).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp