gofmt and add func to get the committed index