jameshartig commented on code in PR #1855: URL: https://github.com/apache/cassandra-gocql-driver/pull/1855#discussion_r2021067000
########## marshal.go: ########## @@ -1579,7 +2113,8 @@ func writeCollectionSize(info CollectionType, n int, buf *bytes.Buffer) error { return nil } -func marshalList(info TypeInfo, value interface{}) ([]byte, error) { +// Marshal marshals the value for the given TypeInfo into a byte slice. +func (listSetCQLType) Marshal(info TypeInfo, value interface{}) ([]byte, error) { listInfo, ok := info.(CollectionType) Review Comment: I've been thinking about this a lot. I'm hesitant to make the `Marshal`/`Unmarshal` interface methods have another parameter when just a few types need it, and potentially no external types need it. I see the `TypeInfo` as a way for the types to store the information they need to marshal and unmarshal, including the list subtype, map subtypes, and also the protocol, if it's needed. An alternative is that we could have `listSetCQLVersion2Type` and `listSetCQLType` and use a different struct for version 2 (and lower) specifically but that felt like a lot of code for one tiny difference. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org