aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fix
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2024-10-01 11:33:50 +0200
committerGopher Robot <gobot@golang.org>2024-10-01 14:55:00 +0000
commitb2a856e82cf889cdba26476b5d55f8dd340604d0 (patch)
tree0c73ac11678c74a400b91a7a0cfb1c2921cb1781 /src/cmd/fix
parentbae2e968e2daadd39c1bdb1221648361d7277ddc (diff)
downloadgo-b2a856e82cf889cdba26476b5d55f8dd340604d0.tar.xz
all: use slices.Delete
Change-Id: Ifb6aa07b32127907cdc2df44b2dbddd6296775c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/616737 Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd/fix')
-rw-r--r--src/cmd/fix/netipv6zone.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/fix/netipv6zone.go b/src/cmd/fix/netipv6zone.go
index 199fcf5bf5..c27b4b4529 100644
--- a/src/cmd/fix/netipv6zone.go
+++ b/src/cmd/fix/netipv6zone.go
@@ -4,7 +4,10 @@
package main
-import "go/ast"
+import (
+ "go/ast"
+ "slices"
+)
func init() {
register(netipv6zoneFix)
@@ -52,7 +55,7 @@ func netipv6zone(f *ast.File) bool {
}
case 1:
if elit, ok := e.(*ast.BasicLit); ok && elit.Value == "0" {
- cl.Elts = append(cl.Elts[:i], cl.Elts[i+1:]...)
+ cl.Elts = slices.Delete(cl.Elts, i, i+1)
} else {
cl.Elts[i] = &ast.KeyValueExpr{
Key: ast.NewIdent("Port"),