Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotExistErr = errors.New("not exist")
)
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
type Stacker ¶
type Stacker interface { Len() int // 大小 IsEmpty() bool // 是否空栈 Peek() (interface{}, error) // 返回栈顶 Pop() (interface{}, error) // 移除并返回当前栈顶 Push(v interface{}) // 入栈 Clean() // 清空栈 }
Stacker 实现Stacker就拥有栈的功能
type SyncStack ¶
type SyncStack struct {
// contains filtered or unexported fields
}
SyncStack 同步栈
func NewSyncStack ¶
NewSyncStack 创建同步栈 stack 实现了 Stacker 接口的非安全栈
Click to show internal directories.
Click to hide internal directories.