30 Star 115 Fork 31

chai2010/Go语言定制指南

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
stack.go 274 Bytes
一键复制 编辑 原始数据 按行查看 历史
chai2010 提交于 2年前 . zz
package main
type Stack struct {
stk []int
}
func (p *Stack) push(i int) {
p.stk = append(p.stk, i)
}
func (p *Stack) pop() int {
if len(p.stk) < 1 {
panic("stk is empty unable to pop")
}
result := p.stk[len(p.stk)-1]
p.stk = p.stk[:len(p.stk)-1]
return result
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/chai2010/go-ast-book.git
git@gitee.com:chai2010/go-ast-book.git
chai2010
go-ast-book
Go语言定制指南
master

搜索帮助