golang version of flush