Skip to content

Commit

Permalink
🔧 build:
Browse files Browse the repository at this point in the history
Remove third-party packages
  • Loading branch information
XiaoK29 committed May 31, 2024
1 parent 787e0e3 commit 258a17c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
14 changes: 3 additions & 11 deletions codes/go/chapter_stack_and_queue/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"testing"

. "github.com/krahets/hello-algo/pkg"
"github.com/stretchr/testify/assert"
)

func TestQueue(t *testing.T) {
Expand Down Expand Up @@ -47,20 +46,13 @@ func TestQueue(t *testing.T) {
}

func TestArrayQueue(t *testing.T) {
t.Run("pop", func(t *testing.T) {
queue := newArrayQueue(2)
assert.Equal(t, nil, queue.pop())

queue.push(1)
queue.push(2)
assert.Equal(t, 1, queue.pop())
assert.Equal(t, 2, queue.pop())
assert.Equal(t, []int{}, queue.toSlice())
})

// 初始化队列,使用队列的通用接口
capacity := 10
queue := newArrayQueue(capacity)
if queue.pop() != nil {
t.Errorf("want:%v,got:%v", nil, queue.pop())
}

// 元素入队
queue.push(1)
Expand Down
8 changes: 0 additions & 8 deletions codes/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
module github.com/krahets/hello-algo

go 1.19

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require github.com/stretchr/testify v1.9.0
10 changes: 0 additions & 10 deletions codes/go/go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 258a17c

Please sign in to comment.