Code examples
Both the client.ConfigureDevice() and client.Device() expect a non-existing wg-foobar interface, so no special tests are required like for integration tests.
Closes #37
Fails on staticcheck, on lines not affected by this PR. Note, running staticcheck against master produces the same errors.
I was in the misunderstanding that Go examples are always ran. I've removed the output requirement and the examples no longer run. wg0 is now used.
Before, I used the global state to split the examples for New() and Client methods. Basically to make the compile work. In the latest commit I've merged the New() and client.ConfigureDevice() into one example Also doing proper error checks now. The client.Device() example is also dropped, as the logic is the check os.IsNotExist(err), which is already shown in client.ConfigureDevice(). This way i could drop the global state for client.
The wgtypes example is now condensed to a single example to show generation of a Private key and Public key from it.
Hope this is better :)
Being new to the library I do appreciate the example, thank you! Helped me get going after being stuck for quite some time.