import ( "git.apache.org/thrift.git/lib/go/thrift" ) protocolFactory := thrift.NewTBinaryProtocolFactoryDefault() transport, err := thrift.NewTSocket(addr) if err != nil { panic(err) } if err := transport.Open(); err != nil { panic(err) } protocol := protocolFactory.GetProtocol(transport) _, err := protocol.ReadListBegin() for err == nil { _, err = protocol.ReadString() } if err != nil && err != thrift.END_OF_LIST { panic(err) } err = protocol.ReadListEnd() if err != nil { panic(err) }In this example, we create a new TBinaryProtocolFactory and a TSocket transport. We then open the transport and get a new protocol instance. We then use `ReadListBegin` to read the start of a list, `ReadString` to read each item in the list, and `ReadListEnd` to signal the end of the list. This code is useful when working with Thrift to decode data in a protocol buffer.