Closed ehudkaldor closed 4 years ago
You're shadowing privKey by declaring it again in the if statement. Generate the key and do the error check after.
priv, err := generate()
if err // ...
damn me, it is. thank you, and closing
No worries!
I'm trying to use
wctrl-go
in a go program, but i am getting weird results.the only usage for wgctrl-go i have currently is to generate keys, which i then put in the
/etc/wireguard/wg0.conf
. it's done with the following code:when i run it, this is what's logged:
here's the weird part: if I copy the private key and generate a public key from it using
wg
, i get a totally different key:And if I use it, the key generated by the
go
code does not work. this is on the the other node:and if i use the public key generated with
wg
on the command line, it works:am i doing something wrong?