BurntSushi / toml

TOML parser for Golang with reflection.
MIT License
4.58k stars 528 forks source link

Use base64 to encode []byte by default #423

Open bokunodev opened 2 months ago

bokunodev commented 2 months ago

Marshal []byte into base64 string instead of array of integers.

arp242 commented 1 month ago

[]byte is just an alias for []uint8. While I don't expect many people are marshaling []uint8 slices to TOML, changing this would make it impossible as there is no way to distinguish between the two.

I also don't think using base64 is strictly better than using an array. Both are reasonable, but I wouldn't want to force one or the other.

Maybe an option can be added once I (finally) finish #328. I don't know. It certainly shouldn't be the default.