OleksiienkoMykyta commented on code in PR #1791:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1791#discussion_r1706855163


##########
metadata.go:
##########
@@ -975,69 +977,207 @@ func getViewsMetadata(session *Session, keyspaceName 
string) ([]ViewMetadata, er
        return views, nil
 }
 
+func extensionsBlobToStrings(value interface{}) (map[string]string, error) {
+       const errorMessage = "gocql.extensionsBlobToStrings failed to read 
column %s"
+       byteData, ok := value.(map[string][]byte)
+       if !ok {
+               return nil, fmt.Errorf(errorMessage, "extentions")
+       }
+
+       extensions := make(map[string]string, len(byteData))
+       for key, rowByte := range byteData {
+               extensions[key] = string(rowByte)
+       }
+
+       return extensions, nil
+}

Review Comment:
   I agree, it will make bytesMapToStringMap more reusable and error handling 
much more readable.
   Thank You very much! 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to