Optimize slicing operations (#4877)

This commit is contained in:
me-cs
2025-05-20 19:36:02 +08:00
committed by GitHub
parent a682bda0bb
commit 4d3681b71c
4 changed files with 138 additions and 10 deletions

View File

@@ -4,9 +4,9 @@ import (
"errors"
"fmt"
"os"
"slices"
"time"
"github.com/zeromicro/go-zero/core/stringx"
"github.com/zeromicro/go-zero/tools/goctl/rpc/execx"
"github.com/zeromicro/go-zero/tools/goctl/util/console"
"github.com/zeromicro/go-zero/tools/goctl/util/ctx"
@@ -37,7 +37,7 @@ func editMod(version string, verbose bool) error {
return err
}
if !stringx.Contains(latest, version) {
if !slices.Contains(latest, version) {
return fmt.Errorf("release version %q is not found", version)
}