Go Developers
func25's profile
Phuong Le@func25•Jun 23, 2025
5.2K
Post cover image

JSON evolution in Go: from v1 to v2

Avatar of antonzAnton Zhiyanov•From antonz.org•Jun 22, 2025•11m read time

Go 1.25 introduces json/v2 package with significant changes from v1. Key improvements include new MarshalWrite/UnmarshalRead functions for direct I/O operations, streaming encode/decode via jsontext package, configurable options for formatting and behavior, enhanced field tags (inline, format, unknown), flexible custom marshalers with MarshalFunc/UnmarshalFunc, and changed default behaviors (nil slices/maps marshal to []/{}). Performance shows similar marshaling speed but 2.7x-10.2x faster unmarshaling. The package remains experimental requiring GOEXPERIMENT=jsonv2 flag.

Sort:

func25's user avatar
Phuong Le
@func25
Joined Oct 20. 2023
5.2K

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard