1. 首页
  2. 主题
  3. Go问与答

go语言index out of range问题

widon1104 · · 4764 次点击
![1.png](http://studygolang.qiniudn.com/170817/878d41682159c4b427231ea85bb50aef.png) 为什么fmt.Println(buf[5:])这一句就不报index out of range问题,而只是fmt.Println(buf[5])这一句才报呢?
这个好像php不会报
#2
更多评论
参考 http://docs.studygolang.com/ref/spec#Slice_expressions `0 <= low <= high <= len(buf)`
#1

用户登录

没有账号?注册

今日阅读排行

    加载中

一周阅读排行

    加载中