mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
generics
This commit is contained in:
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestStack(t *testing.T) {
|
||||
arrayStack := new(collections.ArrayStack)
|
||||
arrayStack := collections.NewArrayStack[string]()
|
||||
arrayStack.Push("cat")
|
||||
arrayStack.Push("dog")
|
||||
arrayStack.Push("hen")
|
||||
@ -19,6 +19,6 @@ func TestStack(t *testing.T) {
|
||||
arrayStack.Push("drag")
|
||||
t.Log("pop:", arrayStack.Pop())
|
||||
arrayStack.Push("test")
|
||||
s := arrayStack.Pop().(string)
|
||||
s := arrayStack.Pop()
|
||||
t.Log(s)
|
||||
}
|
||||
|
Reference in New Issue
Block a user