MCPcopy Create free account
hub / github.com/PacktPublishing/Go-Programming-Cookbook-Second-Edition / Patch

Function Patch

chapter9/mocking/patch.go:18–32  ·  view source on GitHub ↗

Patch sets the value pointed to by the given destination to the given value, and returns a function to restore it to its original value. The value must be assignable to the element type of the destination.

(dest, value interface{})

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

TestPatchFunction · 0.85
TestDoSomeStuffFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by 2

TestPatchFunction · 0.68
TestDoSomeStuffFunction · 0.68