package main
import (
"fmt"
"testing"
"github.com/goccy/go-json"
)
func main() {
type Container struct {
V any `json:"value"`
}
type MapOnly struct {
Map map[string]int64 `json:"map"`
}
b, err := json.Marshal(Container{MapOnly{}})
if err != nil {
panic(err)
}
fmt.Println(string(b))
}
output: {"value":null}
output:
{"value":null}