Skip to content

Commit 75c5640

Browse files
authored
Merge pull request #1992 from socialsister/master
refactor: replace append slice manipulation with slices.Delete
2 parents 4a39802 + e94e27b commit 75c5640

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

internal/prompt/prompt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"os"
2525
"path/filepath"
26+
"slices"
2627
"strconv"
2728
"strings"
2829

@@ -36,7 +37,6 @@ import (
3637
"github.com/onflow/flow-go-sdk/crypto"
3738
"github.com/sergi/go-diff/diffmatchpatch"
3839
"golang.org/x/exp/maps"
39-
"golang.org/x/exp/slices"
4040

4141
"github.com/onflow/flowkit/v2/config"
4242
"github.com/onflow/flowkit/v2/output"
@@ -479,7 +479,7 @@ func NewDeploymentPrompt(
479479
func removeFromStringArray(s []string, el string) []string {
480480
for i, v := range s {
481481
if v == el {
482-
s = append(s[:i], s[i+1:]...)
482+
s = slices.Delete(s, i, i+1)
483483
break
484484
}
485485
}

internal/util/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"fmt"
2525
"os"
2626
"path/filepath"
27+
"slices"
2728
"strings"
2829
"text/tabwriter"
2930

@@ -108,7 +109,7 @@ func ValidateECDSAP256Pub(key string) error {
108109
func removeFromStringArray(s []string, el string) []string {
109110
for i, v := range s {
110111
if v == el {
111-
s = append(s[:i], s[i+1:]...)
112+
s = slices.Delete(s, i, i+1)
112113
break
113114
}
114115
}

0 commit comments

Comments
 (0)