mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
single argument panic
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev https://golang.org/cl/850041
This commit is contained in:
parent
5d0ec6c076
commit
00f9f0c056
60 changed files with 929 additions and 813 deletions
|
|
@ -571,7 +571,7 @@ func (v *ArrayValue) Elem(i int) Value {
|
|||
typ := v.typ.(*ArrayType).Elem()
|
||||
n := v.Len()
|
||||
if i < 0 || i >= n {
|
||||
panic("index", i, "in array len", n)
|
||||
panic("array index out of bounds")
|
||||
}
|
||||
p := addr(uintptr(v.addr()) + uintptr(i)*typ.Size())
|
||||
return newValue(typ, p, v.canSet)
|
||||
|
|
@ -642,7 +642,7 @@ func (v *SliceValue) Get() uintptr {
|
|||
func (v *SliceValue) Slice(beg, end int) *SliceValue {
|
||||
cap := v.Cap()
|
||||
if beg < 0 || end < beg || end > cap {
|
||||
panic("slice bounds [", beg, ":", end, "] with capacity ", cap)
|
||||
panic("slice index out of bounds")
|
||||
}
|
||||
typ := v.typ.(*SliceType)
|
||||
s := new(SliceHeader)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue