Skip to content

Commit 1739b71

Browse files
committed
pkg/systemd/quadlet: rm splitPorts
Usage of splitPorts was removed by commit abc4cfb ("quadlet: allow variables in PublishPort") but the function remained, as well as its tests. Drop those. Found by running golangci-lint with --tests=false option. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent c9b108d commit 1739b71

File tree

2 files changed

+0
-74
lines changed

2 files changed

+0
-74
lines changed

pkg/systemd/quadlet/quadlet.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -480,35 +480,6 @@ func checkForUnknownKeys(unit *parser.UnitFile, groupName string, supportedKeys
480480
return err
481481
}
482482

483-
func splitPorts(ports string) []string {
484-
parts := make([]string, 0)
485-
486-
// IP address could have colons in it. For example: "[::]:8080:80/tcp, so we split carefully
487-
start := 0
488-
end := 0
489-
for end < len(ports) {
490-
switch ports[end] {
491-
case '[':
492-
end++
493-
for end < len(ports) && ports[end] != ']' {
494-
end++
495-
}
496-
if end < len(ports) {
497-
end++ // Skip ]
498-
}
499-
case ':':
500-
parts = append(parts, ports[start:end])
501-
end++
502-
start = end
503-
default:
504-
end++
505-
}
506-
}
507-
508-
parts = append(parts, ports[start:end])
509-
return parts
510-
}
511-
512483
func usernsOpts(kind string, opts []string) string {
513484
var res strings.Builder
514485
res.WriteString(kind)

pkg/systemd/quadlet/quadlet_test.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)