I'm expecting {"a":"42","b":"78"} from the following code, but it doesn't do it.
package main
import (
"encoding/json"
"fmt"
)
type S struct {
A int `json:"a,string"`
B *int `json:"b,string"`
}
func main() {
var s S
json.Unmarshal([]byte(`{"a":"42","b":"78"}`), &s)
m, _ := json.Marshal(s)
fmt.Println(string(m))
}
Am I doing something wrong?