patch

command module
v0.0.0-...-caf1519 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

README

Patch

通过 Patch 更新结构体。

修改字段:

$ go run github.com/BedivereZero/learning-notes/golang/json/patch -p patch-age.json
Original: {"name":"Flandre","age":495}
Modified: {"name":"Flandre","age":17}

新增字段:

$ go run github.com/BedivereZero/learning-notes/golang/json/patch -p patch-sleep.json
Original: {"name":"Flandre","age":495}
Modified: {"name":"Flandre","age":495,"sleep":true}

修改多个字段:

$ go run github.com/BedivereZero/learning-notes/golang/json/patch -p patch-sleep-and-age-0.json
Original: {"name":"Flandre","age":495}
Modified: {"name":"Flandre","sleep":true}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL