mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 09:57:07 +02:00
enforce explanation for necessary nolints and fix bugs (#34883)
Follows up https://github.com/go-gitea/gitea/pull/34851 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
9854df3e87
commit
aa9d86745a
48 files changed
+83
-159
No files matched your search
@@ -75,11 +75,9 @@ func IsMigrateURLAllowed(remoteURL string, doer *user_model.User) error {
|
||||
return &git.ErrInvalidCloneAddr{Host: u.Host, IsProtocolInvalid: true, IsPermissionDenied: true, IsURLError: true}
|
||||
}
|
||||
|
||||
hostName, _, err := net.SplitHostPort(u.Host)
|
||||
if err != nil {
|
||||
// u.Host can be "host" or "host:port"
|
||||
err = nil //nolint:ineffassign,wastedassign
|
||||
hostName = u.Host
|
||||
hostName, _, errIgnored := net.SplitHostPort(u.Host)
|
||||
if errIgnored != nil {
|
||||
hostName = u.Host // u.Host can be "host" or "host:port"
|
||||
}
|
||||
|
||||
// some users only use proxy, there is no DNS resolver. it's safe to ignore the LookupIP error
|
||||
|
||||
Reference in new issue
Block a user