`buf.Type` is already an `int64` why do you need to cast ?