From 6f0301aff283cde0e1c96f4268c1a297f30e5441 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Tue, 3 Dec 2024 19:50:57 +0100 Subject: [PATCH] move golang.org/x/exp to now default library This commit removes the direct uses of golang.org/x/exp as most used functions are in the standard library now. --- cmd/web.go | 11 ++++++----- env/uservars.go | 2 +- git/plumbing.go | 2 +- git/plumbing_test.go | 2 +- go.mod | 2 +- internal/walker/context.go | 3 +-- internal/walker/walker.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index b2b336b..88ad7e3 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -3,15 +3,13 @@ package cmd //spellchecker:words path filepath github ggman internal goprogram exit golang maps slices browser import ( "path/filepath" + "slices" + "github.com/pkg/browser" "github.com/tkw1536/ggman" "github.com/tkw1536/ggman/env" "github.com/tkw1536/ggman/internal/path" "github.com/tkw1536/goprogram/exit" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" - - "github.com/pkg/browser" ) //spellchecker:words CANSPEC godoc localgodoc reclone urlweb positionals GGROOT worktree weburl workdir @@ -251,7 +249,10 @@ func (uw urlweb) Run(context ggman.Context) error { } func (uw urlweb) listBases(context ggman.Context) error { - bases := maps.Keys(WebBuiltInBases) + bases := make([]string, 0, len(WebBuiltInBases)) + for key := range WebBuiltInBases { + bases = append(bases, key) + } slices.Sort(bases) for _, name := range bases { diff --git a/env/uservars.go b/env/uservars.go index b1c49e2..88b6396 100644 --- a/env/uservars.go +++ b/env/uservars.go @@ -2,10 +2,10 @@ package env //spellchecker:words strings github goprogram meta golang slices import ( + "slices" "strings" "github.com/tkw1536/goprogram/meta" - "golang.org/x/exp/slices" ) //spellchecker:words GGROOT ggman workdir diff --git a/git/plumbing.go b/git/plumbing.go index 5ff8a18..38c80a9 100644 --- a/git/plumbing.go +++ b/git/plumbing.go @@ -7,9 +7,9 @@ import ( "path" "path/filepath" "runtime" + "slices" "github.com/pkg/errors" - "golang.org/x/exp/slices" git "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" diff --git a/git/plumbing_test.go b/git/plumbing_test.go index 9b617a6..6a147db 100644 --- a/git/plumbing_test.go +++ b/git/plumbing_test.go @@ -6,6 +6,7 @@ import ( "path" "path/filepath" "reflect" + "slices" "testing" git "github.com/go-git/go-git/v5" @@ -14,7 +15,6 @@ import ( "github.com/tkw1536/ggman/internal/testutil" "github.com/tkw1536/pkglib/stream" "github.com/tkw1536/pkglib/testlib" - "golang.org/x/exp/slices" ) //spellchecker:words gogit commita commitb worktree diff --git a/go.mod b/go.mod index 11f4245..ef92a1c 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( github.com/pkg/errors v0.9.1 github.com/tkw1536/goprogram v0.6.0 github.com/tkw1536/pkglib v0.0.0-20241125083302-9392aba00be6 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f ) require ( @@ -35,6 +34,7 @@ require ( github.com/skeema/knownhosts v1.3.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.29.0 // indirect + golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/net v0.31.0 // indirect golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.26.0 // indirect diff --git a/internal/walker/context.go b/internal/walker/context.go index 3c182bb..d28d05a 100644 --- a/internal/walker/context.go +++ b/internal/walker/context.go @@ -4,8 +4,7 @@ package walker //spellchecker:words golang slices import ( "io/fs" - - "golang.org/x/exp/slices" + "slices" ) // context implements WalkerContext diff --git a/internal/walker/walker.go b/internal/walker/walker.go index 2bf85a7..9cdd1ea 100644 --- a/internal/walker/walker.go +++ b/internal/walker/walker.go @@ -7,13 +7,13 @@ package walker import ( "errors" "io/fs" + "slices" "strings" "sync" "sync/atomic" "github.com/tkw1536/ggman/internal/record" "github.com/tkw1536/pkglib/sema" - "golang.org/x/exp/slices" ) // Walker is an object that can recursively operate on all subdirectories of a directory and score those matching a specific criterion.