patch

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(target interface{}, patch map[string]interface{}) (changed bool, err error)

Apply updates the target struct in-place with non-zero values from the patch struct. Only fields with the same name and type get updated. Fields in the patch struct can be pointers to the target's type.

Returns true if any value has been changed.

func Struct

func Struct(target, patch interface{}) (changed bool, err error)

Struct updates the target struct in-place with non-zero values from the patch struct. Only fields with the same name and type get updated. Fields in the patch struct can be pointers to the target's type.

Returns true if any value has been changed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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