Add defer

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>
This commit is contained in:
Kevin Wang 2016-07-19 11:53:01 +08:00
parent c31882a5f2
commit 074dab86b9

View File

@ -203,7 +203,7 @@ func (c *Fake) InvokesProxy(action Action) restclient.ResponseWrapper {
// ClearActions clears the history of actions called on the fake client
func (c *Fake) ClearActions() {
c.Lock()
c.Unlock()
defer c.Unlock()
c.actions = make([]Action, 0)
}