-
Notifications
You must be signed in to change notification settings - Fork 21
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
Some return types are not public #7
Comments
Hi @mullerch You can get the values as following: (ignored errors by _)
Most of the structs are just helper structs,in order to access the raw dbus values in a more convenient way. Getting the different values can caus multiple errors on dbus side + parsing etc. The functions are created to make the user aware of these errors. In my opinion there is no need to make the structs public, as their properties are public and functions to access them exist. (and the users can not do anything with these structs on their own...) Let me know if I am wrong and any improvements/PRs are welcome Additionally, a basic example exist here: https://github.com/maltegrosse/go-modemmanager/blob/master/examples/test_run.go |
Thanks for your quick answer. With private visibility of the type, the library user cannot:
1 & 2 impose design constraints to the user's code, which is weird (e.g. you cannot create a wrapper function without abstracting the type). I don't see any reason why one may need 3. I suggest making those types public so that there are no such constraints (I can PR that). |
@mullerch , thanks for explanation. Sure, more than welcome to do a PR. But please consider all structs (I think 19) Thank you. PS thanks (wifx) for the network manager golang library - was my inspiration for getting started with go and modem manager... |
Credits for gonetworkmanager have to go to https://github.com/BellerophonMobile/ who initially made that library |
Some public functions, such as Modem3gpp.Scan() return private types (network3Gpp). Those types have no functions that can ingest them to return useful public types. Those functions seem therefore useless.
I don't see a reason for the following types (non-exhaustive) to be made private:
Is this visibility intentional? If yes, how are we supposed to use the output of those functions?
The text was updated successfully, but these errors were encountered: