mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 05:18:29 +00:00
update golangci-lint to v2.7.0 (#36079)
- Update and autofix most issues - Corrected variable names to `cutOk` - Impossible condition in `services/migrations/onedev_test.go` removed - `modules/setting/config_env.go:128:3` looks like a false-positive, added nolint
This commit is contained in:
@@ -215,8 +215,8 @@ func addValidGroupTeamMapRule() {
|
||||
}
|
||||
|
||||
func portOnly(hostport string) string {
|
||||
colon := strings.IndexByte(hostport, ':')
|
||||
if colon == -1 {
|
||||
_, after, ok := strings.Cut(hostport, ":")
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
if i := strings.Index(hostport, "]:"); i != -1 {
|
||||
@@ -225,7 +225,7 @@ func portOnly(hostport string) string {
|
||||
if strings.Contains(hostport, "]") {
|
||||
return ""
|
||||
}
|
||||
return hostport[colon+len(":"):]
|
||||
return after
|
||||
}
|
||||
|
||||
func validPort(p string) bool {
|
||||
|
||||
Reference in New Issue
Block a user