You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the -only option to limit the generated file to just the needed interface the generator still adds imports of "fmt" and "errors" at the top. Those imports are only used in the Signal section of the generated code shown below and that section isn't included in the generated file when -only is used. These imports have to be manually removed after generation right now in order for the file to compile.
Signal section
// Signal is a common interface for all signals.typeSignalinterface {
Name() stringInterface() stringSender() stringpath() dbus.ObjectPathvalues() []interface{}
}
// ErrUnknownSignal is returned by LookupSignal when a signal cannot be resolved.varErrUnknownSignal=errors.New("unknown signal")
// LookupSignal converts the given raw D-Bus signal with variable body// into one with typed structured body or returns ErrUnknownSignal error.funcLookupSignal(signal*dbus.Signal) (Signal, error) {
switchsignal.Name {
caseInterfaceOrgFreedesktopDBusProperties+"."+"PropertiesChanged":
v0, ok:=signal.Body[0].(string)
if!ok {
returnnil, fmt.Errorf("prop .Interface is %T, not string", signal.Body[0])
}
v1, ok:=signal.Body[1].(map[string]dbus.Variant)
if!ok {
returnnil, fmt.Errorf("prop .ChangedProperties is %T, not map[string]dbus.Variant", signal.Body[1])
}
v2, ok:=signal.Body[2].([]string)
if!ok {
returnnil, fmt.Errorf("prop .InvalidatedProperties is %T, not []string", signal.Body[2])
}
return&OrgFreedesktopDBusPropertiesPropertiesChangedSignal{
sender: signal.Sender,
Path: signal.Path,
Body: &OrgFreedesktopDBusPropertiesPropertiesChangedSignalBody{
Interface: v0,
ChangedProperties: v1,
InvalidatedProperties: v2,
},
}, nildefault:
returnnil, ErrUnknownSignal
}
}
The text was updated successfully, but these errors were encountered:
When using the
-only
option to limit the generated file to just the needed interface the generator still adds imports of"fmt"
and"errors"
at the top. Those imports are only used in theSignal
section of the generated code shown below and that section isn't included in the generated file when-only
is used. These imports have to be manually removed after generation right now in order for the file to compile.Signal section
The text was updated successfully, but these errors were encountered: