github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/state/clock.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package state 5 6 import ( 7 "github.com/juju/utils/clock" 8 ) 9 10 // GetClock exists to allow us to patch out time-handling; specifically 11 // for the worker/uniter tests that want to know what happens when leases 12 // expire unexpectedly. 13 // 14 // TODO(fwereade): lp:1479653 15 // This is *clearly* a bad idea, and we should be injecting the dependency 16 // explicitly -- and using an injected clock across the codebase -- but, 17 // time pressure. 18 var GetClock = func() clock.Clock { 19 return clock.WallClock 20 }