update lock_write go code