golang defer implements in python