I use RawMessage to precompute part of a json message.
RawMessage is a raw encoded JSON object. It implements Marshaler and
Unmarshaler and can be used to delay JSON decoding or precompute a JSON
encoding.
from http://golang.org/pkg/encoding/json/#RawMessage
Following code shows the problem:
package main
import "encoding/json"
type S struct{ R json.RawMessage }
func main() {
s := S{json.RawMessage([]byte(`42`))}
b, _ := json.Marshal(s)
println(string(b)) // {"R":"NDI="} Expected: {"R":42}
}
Is this behaviour expected?
I have made a patch to go tip to fix this, should i send it for review?
Thank you for this great language!
Ron
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.