github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/apiserver/instancepoller/export_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package instancepoller 5 6 import ( 7 "github.com/juju/juju/state" 8 ) 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 }