Structs Source && Sync have unexported field
Opened this issue · 0 comments
drdeimos commented
Hi. Why this struct fields leave unexported?
Lines 5 to 8 in 75628da
Lines 5 to 8 in 75628da
For i.e. i want get sink properties like this:
func main() {
client, err := pulse.NewClient()
defer client.Close()
sources, err := client.ListSources()
....
for _, source := range sources {
if isBluetoothDevice(client, source) {
fmt.Printf("device name: %s", source.Name)
fmt.Println("----------")
}
}
}
func isBluetoothDevice(device interface{}) bool {
switch device := device.(type) {
case *pulse.Source:
_, ok := device.Properties["device.api"]
if device.(pulse.Source).info.Properties["device.api"] == "bluez"
return true
.....
default:
return false
}
}
But field info unexported 😞