amenzhinsky / dbus-codegen-go

D-Bus code-generation for golang
MIT License
16 stars 14 forks source link

Duplicate argument error in generated code #10

Open mdegat01 opened 2 years ago

mdegat01 commented 2 years ago

I ran the tool to generate the bindings for the systemd-resolve service and the generated code had a bunch of "duplicate argument" errors.

The problem is that the ResolveHostname, ResolveAddress, ResolveRecord and ResolveService methods of the org.freedesktop.resolve1.Manager interface have both an input and an output named flags. The generator seems to take the names as is which leads to duplicate argument errors in the generated code. Ideally the generator would modify the name of input like flags1 or in_flags or something when an input and an output had the same name.

To get the XML of the interface you can run the following on a linux system:

gdbus introspect --xml --system --dest org.freedesktop.resolve1 --object-path /org/freedesktop/resolve1

I also uploaded the XML this gives you here