I'm trying to get the values from TagLib::PropertyMap into Go. I've seen some ways that work in getting the values by looping over k/v pairs but is that the most efficient way to do that? Shouldn't I just be able to return PropertyMap from C++ and cast to a map[string]string?
Asked
Active
Viewed 42 times
-2
-
2Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! See also: [ask] – rizerphe May 11 '20 at 03:50
1 Answers
0
Shouldn't I just be able to return PropertyMap from C++ and cast to a map[string]string?
No, of course not:
There are no casts in Go, only type conversions.
The PropertyMap type of C++ and Go's map type are completely different so you cannot type convert them.
Even if you could type convert the map types: The string type of C++ and Go are completely different.

Volker
- 40,468
- 7
- 81
- 87