go-json-experiment / json

Experimental implementation of a proposed v2 encoding/json package
BSD 3-Clause "New" or "Revised" License
341 stars 11 forks source link

NewEncoder in v2 #18

Closed clarkk closed 4 months ago

clarkk commented 8 months ago

I get a compile error undefined: json.NewEncoder

How to translate this into v2? :) if err := json.NewEncoder(gz).Encode(bytes); err != nil {

dsnet commented 8 months ago

The v2 equivalent would be:

if err := json.MarshalWrite(gz, bytes); err != nil { ... }
dsnet commented 4 months ago

Closing as complete.