refactor: replace custom helper with stdlib strings.*

This commit is contained in:
yusing
2026-02-18 14:26:29 +08:00
parent c2d8cca3b4
commit bb757b2432
9 changed files with 15 additions and 16 deletions

View File

@@ -46,8 +46,8 @@ func (c containerHelper) getMounts() *ordered.Map[string, string] {
}
func (c containerHelper) parseImage() *types.ContainerImage {
colonSep := strutils.SplitRune(c.Image, ':')
slashSep := strutils.SplitRune(colonSep[0], '/')
colonSep := strings.Split(c.Image, ":")
slashSep := strings.Split(colonSep[0], "/")
_, sha256, _ := strings.Cut(c.ImageID, ":")
im := &types.ContainerImage{
SHA256: sha256,

View File

@@ -9,7 +9,6 @@ import (
"github.com/goccy/go-yaml"
"github.com/yusing/godoxy/internal/types"
gperr "github.com/yusing/goutils/errs"
strutils "github.com/yusing/goutils/strings"
)
var ErrInvalidLabel = errors.New("invalid label")
@@ -31,7 +30,7 @@ func ParseLabels(labels map[string]string, aliases ...string) (types.LabelMap, e
ExpandWildcard(labels, aliases...)
for lbl, value := range labels {
parts := strutils.SplitRune(lbl, '.')
parts := strings.Split(lbl, ".")
if parts[0] != NSProxy {
continue
}