From d5688b73be6de5c53b9541b09feb6a4e32f02b33 Mon Sep 17 00:00:00 2001 From: bbrodriges Date: Sun, 16 Sep 2018 12:54:54 +0300 Subject: [PATCH] add convenient Patches constructor --- patch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patch.go b/patch.go index 5121b59..619f18a 100644 --- a/patch.go +++ b/patch.go @@ -50,6 +50,10 @@ func create() *Patches { return &Patches{originals: make(map[reflect.Value][]byte), values: make(map[reflect.Value]reflect.Value)} } +func NewPatches() *Patches { + return create() +} + func (this *Patches) ApplyFunc(target, double interface{}) *Patches { t := reflect.ValueOf(target) d := reflect.ValueOf(double)