Skip to content

Commit

Permalink
move golang.org/x/exp to now default library
Browse files Browse the repository at this point in the history
This commit removes the direct uses of golang.org/x/exp as most used
functions are in the standard library now.
  • Loading branch information
tkw1536 committed Dec 3, 2024
1 parent c0d1211 commit 6f0301a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
11 changes: 6 additions & 5 deletions cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion env/uservars.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion git/plumbing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion git/plumbing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path"
"path/filepath"
"reflect"
"slices"
"testing"

git "github.com/go-git/go-git/v5"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions internal/walker/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ package walker
//spellchecker:words golang slices
import (
"io/fs"

"golang.org/x/exp/slices"
"slices"
)

// context implements WalkerContext
Expand Down
2 changes: 1 addition & 1 deletion internal/walker/walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6f0301a

Please sign in to comment.