Update docs - #44
Conversation
There was a problem hiding this comment.
I don't understand this part at all. You should only ever import one backend. It so happens that the init package uses build rules to import one based on the platform.
There was a problem hiding this comment.
I'm assuming your trouble is with the line: "If you would like to disable a backend, you must import all...".
When I said "import all", I meant create files with the appropriate names so that the build rules will import the correct one. It could maybe be changed to "create import files for all".
The idea was if you did not want your project to support say...OSX for some reason, you could manually import the other 2 backends by creating files with the appropriate filters rather than importing init. This would effectively "disable" being able to build for OSX. Perhaps this is not worth including, but I thought you did a good job explaining how to manually import so I didn't want to delete it.
All I really want with this PR is to update the documentation to say you can do:
import _ "github.com/skelterjohn/go.wde/init"
and it will register the right backend for you. I won't be offended if you reject this PR and add it to the documentation in a better way. sigh Writing is hard :( Sorry for the confusion.
|
This section of the docs in particular should be in the README imo. Unless OSX is your primary development platform the portable program structure is easy to overlook as everything works fine in linux/windows without ever calling wde.Run/Stop. |
I noticed in wdetest.go it imports the init directory rather than importing the way the docs suggest. This seems to be a more convenient way to import in most cases and so I update the docs to reflect that.
As I didn't consult with anyone before making these changes, feel free to reject this pull request if there is a reason it is the way it is or if you just don't like my change.