move cleanup in defer function
Merge branch 'master' of https://github.com/gobs/cmd