THRIFT-2502 Go simplify and optimize