mirror of
https://github.com/golang/go
synced 2024-11-21 19:04:44 -07:00
asn1: marshal true as 255, not 1.
OS X, at least, appears to test |byte == 255|, not |byte != 0| to establish if a bool is true or false. R=golang-dev, r CC=golang-dev https://golang.org/cl/4128064
This commit is contained in:
parent
5626bd9e38
commit
566d432f54
@ -317,7 +317,7 @@ func marshalBody(out *forkableWriter, value reflect.Value, params fieldParameter
|
||||
switch v := value.(type) {
|
||||
case *reflect.BoolValue:
|
||||
if v.Get() {
|
||||
return out.WriteByte(1)
|
||||
return out.WriteByte(255)
|
||||
} else {
|
||||
return out.WriteByte(0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user