I've got a struct with a []uint8
member and I'm writing it with json.Marshal
. Trouble is, it's interpreting the uint8
s as char
s and it outputs a string rather than an array of numbers.
I can get this to work if it's a []int
, but I don't want to have to allocate and copy over the items if I can avoid it. Can I?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…