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