30 Star 116 Fork 31

chai2010/Go语言定制指南

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
appendix
a-goyacc
b-antlr4
calc
Calc.g4
Makefile
go.mod
go.sum
listener.go
main.go
readme.md
stack.go
visitor.go
vscode.png
readme.md
ch1
ch10
ch11
ch12
ch13
ch14
ch15
ch16
ch2
ch3
ch4
ch5
ch6
ch7
ch8
ch9
images
js
theme
.bookignore
.editorconfig
.gitignore
LICENSE
Makefile
README.md
SUMMARY.md
book.toml
cover.jpg
index.md
preface.md
style.css
weixin-guanggu-coder.jpeg
克隆/下载
stack.go 274 Bytes
一键复制 编辑 原始数据 按行查看 历史
chai2010 提交于 3年前 . 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

搜索帮助