Implement go style "defer".