Browse Source

codec: json: fix build for go 1.7 - do not goto past new const/variables

Ugorji Nwoke 8 years ago
parent
commit
2d49ec7f88
1 changed files with 1 additions and 1 deletions
  1. 1 1
      codec/json.go

+ 1 - 1
codec/json.go

@@ -1097,6 +1097,7 @@ func (d *jsonDecDriver) appendStringAsBytes() {
 }
 
 func (d *jsonDecDriver) nakedNum(z *decNaked, bs []byte) (err error) {
+	const cutoff = uint64(1 << uint(64-1))
 	var n uint64
 	var neg, badsyntax, overflow bool
 
@@ -1107,7 +1108,6 @@ func (d *jsonDecDriver) nakedNum(z *decNaked, bs []byte) (err error) {
 	if badsyntax || overflow {
 		goto F
 	}
-	const cutoff = uint64(1 << uint(64-1))
 	if neg {
 		if n > cutoff {
 			goto F