cmd/go: delete cmd/go/internal/slices in favor of slices

Some files already use "slices", others use "cmd/go/internal/slices".
(Some files are using more than slices.Clip and must use "slices".)
Use "slices" consistently and delete cmd/go/internal/slices.

Change-Id: I69ec680106ad2924276f7473e6547a3a907efc96
Reviewed-on: https://go-review.googlesource.com/c/go/+/499715
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2023-05-31 16:45:03 -04:00 committed by Gopher Robot
parent abdaa0f9aa
commit b100e127ca
9 changed files with 10 additions and 21 deletions

View File

@ -18,6 +18,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"slices"
"strconv"
"strings"
@ -25,7 +26,6 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/load"
"cmd/go/internal/modload"
"cmd/go/internal/slices"
"cmd/go/internal/str"
"cmd/go/internal/work"
)

View File

@ -14,6 +14,7 @@ import (
"os"
"path"
"path/filepath"
"slices"
"strconv"
"strings"
"sync"
@ -26,7 +27,6 @@ import (
"cmd/go/internal/modconv"
"cmd/go/internal/modfetch"
"cmd/go/internal/search"
"cmd/go/internal/slices"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"

View File

@ -12,6 +12,7 @@ import (
"io/fs"
"os"
pathpkg "path"
"slices"
"sort"
"strings"
"sync"
@ -24,7 +25,6 @@ import (
"cmd/go/internal/modfetch/codehost"
"cmd/go/internal/modinfo"
"cmd/go/internal/search"
"cmd/go/internal/slices"
"cmd/go/internal/str"
"cmd/go/internal/trace"
"cmd/internal/pkgpattern"

View File

@ -5,9 +5,10 @@
package mvs
import (
"cmd/go/internal/gover"
"cmd/go/internal/slices"
"fmt"
"slices"
"cmd/go/internal/gover"
"golang.org/x/mod/module"
)

View File

@ -1,12 +0,0 @@
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: Replace with slices package when it lands in standard library.
package slices
// Clip removes unused capacity from the slice, returning s[:len(s):len(s)].
func Clip[S ~[]E, E any](s S) S {
return s[:len(s):len(s)]
}

View File

@ -16,6 +16,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"slices"
"strconv"
"strings"
"sync"
@ -28,7 +29,6 @@ import (
"cmd/go/internal/lockedfile"
"cmd/go/internal/modload"
"cmd/go/internal/search"
"cmd/go/internal/slices"
"cmd/go/internal/str"
"cmd/go/internal/trace"
"cmd/go/internal/work"

View File

@ -5,12 +5,12 @@
package vcweb
import (
"cmd/go/internal/slices"
"log"
"net/http"
"net/http/cgi"
"os/exec"
"runtime"
"slices"
"sync"
)

View File

@ -6,7 +6,6 @@ package vcweb
import (
"bufio"
"cmd/go/internal/slices"
"context"
"errors"
"io"
@ -16,6 +15,7 @@ import (
"net/url"
"os"
"os/exec"
"slices"
"strings"
"sync"
"time"

View File

@ -25,6 +25,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"slices"
"sort"
"strconv"
"strings"
@ -38,7 +39,6 @@ import (
"cmd/go/internal/gover"
"cmd/go/internal/load"
"cmd/go/internal/modload"
"cmd/go/internal/slices"
"cmd/go/internal/str"
"cmd/go/internal/trace"
"cmd/internal/buildid"