github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/apiserver/machinemanager/export_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package machinemanager 5 6 import "github.com/juju/juju/state" 7 8 type StateInterface stateInterface 9 10 type Patcher interface { 11 PatchValue(ptr, value interface{}) 12 } 13 14 func PatchState(p Patcher, st StateInterface) { 15 p.PatchValue(&getState, func(*state.State) stateInterface { 16 return st 17 }) 18 }