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
The Addresser interface declares the Set(val string) and SetRandom(bool) receivers but all implementations implement these as value receivers that ineffectively attempt to modify their own state. This is triggering the go static check SA4005.
These implementations should be pointer receivers but changing them will unfortunately modify the API. All Address objects would need to be passed around as *Address pointers as the Address type will no longer implement the Addresser interface. This is most obvious in func (a *Adapter) Connect(address Addresser, params ConnectionParams) (*Device, error).
The text was updated successfully, but these errors were encountered:
Without it, these calls are a no-op.
Fixes: #144
In particular, this fixes a problem where IsRandom() would always return
false on Linux. With this fix, it correctly returns whether the address
is a random address.
This is indeed a bug, thanks for spotting it!
Here is a fix: #158
These implementations should be pointer receivers but changing them will unfortunately modify the API. All Address objects would need to be passed around as *Address pointers as the Address type will no longer implement the Addresser interface.
At least with the current dev branch, no API change is necessary.
The
Addresser
interface declares theSet(val string)
andSetRandom(bool)
receivers but all implementations implement these as value receivers that ineffectively attempt to modify their own state. This is triggering the go static check SA4005.bluetooth/gap_darwin.go
Lines 27 to 33 in e79ea1e
These implementations should be pointer receivers but changing them will unfortunately modify the API. All
Address
objects would need to be passed around as*Address
pointers as theAddress
type will no longer implement theAddresser
interface. This is most obvious infunc (a *Adapter) Connect(address Addresser, params ConnectionParams) (*Device, error)
.The text was updated successfully, but these errors were encountered: