mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
all: remove now-unnecessary unreachable panics
Take advantage of the new terminating statement rule. R=golang-dev, r, gri CC=golang-dev https://golang.org/cl/7712044
This commit is contained in:
parent
5f91a62a3c
commit
e15c0ac693
32 changed files with 1 additions and 39 deletions
|
|
@ -739,6 +739,7 @@ func (d *decodeState) valueInterface() interface{} {
|
|||
switch d.scanWhile(scanSkipSpace) {
|
||||
default:
|
||||
d.error(errPhase)
|
||||
panic("unreachable")
|
||||
case scanBeginArray:
|
||||
return d.arrayInterface()
|
||||
case scanBeginObject:
|
||||
|
|
@ -746,7 +747,6 @@ func (d *decodeState) valueInterface() interface{} {
|
|||
case scanBeginLiteral:
|
||||
return d.literalInterface()
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// arrayInterface is like array but returns []interface{}.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue