gofmt and fix deadlock