mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-01-24 06:52:16 +08:00
25 lines
341 B
Go
25 lines
341 B
Go
|
package collection
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
type item struct {
|
||
|
Name string
|
||
|
}
|
||
|
|
||
|
func (i *item) HashCode() string {
|
||
|
return i.Name
|
||
|
}
|
||
|
|
||
|
func TestRemove(t *testing.T) {
|
||
|
q := NewFifoQueue()
|
||
|
q.Push(&item{Name: "1"})
|
||
|
q.Push(&item{Name: "2"})
|
||
|
q.Push(&item{Name: "3"})
|
||
|
q.Push(&item{Name: "4"})
|
||
|
q.Remove(&item{Name: "3"})
|
||
|
fmt.Println(q)
|
||
|
}
|