Skip to content

Commit

Permalink
Use built-in slices and maps packages (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokiat authored Apr 3, 2024
1 parent dba7e48 commit 56221a5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ds/heap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ds

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

// NewHeap creates a new Heap instance that is configured to use the
// specified better function to order items. When better returns true, the
Expand Down
2 changes: 1 addition & 1 deletion ds/list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ds

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

// NewList creates a new List with the given capacity. The capacity can be
// used as a form of optimization. Regardless of the value, the initial size
Expand Down
2 changes: 1 addition & 1 deletion ds/set.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ds

import "golang.org/x/exp/maps"
import "maps"

// NewSet creates a new Set instance with the specified initial capacity,
// which is only used to preallocate memory and does not act as an upper bound.
Expand Down
2 changes: 1 addition & 1 deletion ds/stack.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ds

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

// NewStack creates a new Stack instance with the specified initial capacity,
// which only serves to preallocate memory. Exceeding the initial capacity is
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package gog_test

import (
"fmt"
"slices"
"strconv"
"strings"

"github.com/mokiat/gog"
"golang.org/x/exp/slices"
)

func ExampleDedupe() {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.22
require (
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
)

require (
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
Expand Down
2 changes: 1 addition & 1 deletion slice.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gog

import "golang.org/x/exp/maps"
import "maps"

// Map can be used to transform one slice into another by providing a
// function to do the mapping.
Expand Down

0 comments on commit 56221a5

Please sign in to comment.