-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type dbus.Error
is not comparable.
#317
Comments
Regarding runtime panic: do you have a minimal example of what you mean? As far as I'm aware, this should be a compiler error in all cases. E.g.: package dbus
import (
"testing"
)
func TestCompareError(t *testing.T) {
a := Error{
Name: "foo",
Body: []interface{}{1},
}
b := Error{
Name: "bar",
Body: []interface{}{"baz"},
}
_ = a == b
} gives me |
While this trivial comparison produces a compile error, as soon as you treat the objects involved as
|
Fair point, I didn't have that in mind. This is unfortunate, but I don't see this as an issue that would justify a breaking API change: |
See e.g. package dbus
import (
"fmt"
"io"
"testing"
)
func TestCompareError(t *testing.T) {
var a error = Error{
Name: "foo",
Body: []interface{}{1},
}
var b error = io.EOF
fmt.Println(a == b)
}
|
Type
dbus.Error
is not comparable. This means that any attempt to compare an error returned from a dbus call with any other error will compile but result in a runtime panic.The text was updated successfully, but these errors were encountered: