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

Fix removeEmptyPort#76652

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dxasu wants to merge3 commits intogolang:master
base:master
Choose a base branch
Loading
fromdxasu:patch-1
Open
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Simplify removeEmptyPort function implementation
  • Loading branch information
@dxasu
dxasu authoredDec 2, 2025
commit2eb154b9d1bca71b811e2842a5696727a103f0b2
4 changes: 1 addition & 3 deletionssrc/net/http/http.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -113,9 +113,7 @@ func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastInd
// removeEmptyPort strips the empty port in ":port" to ""
// as mandated by RFC 3986 Section 6.2.3.
func removeEmptyPort(host string) string {
if len(host) > 0 && host[len(host)-1] == ':' {
return host[:len(host)-1]
}
host, _ = strings.CutSuffix(host, ":")
return host
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp