twitchyliquid64 / subnet

Simple, auditable & elegant VPN, built with TLS mutual authentication and TUN.
MIT License
1.06k stars 79 forks source link

support 'go get', 'go install' #7

Closed jpillora closed 6 years ago

jpillora commented 6 years ago

First off, awesome project 👍

This PR doesn't change any files (except for package import paths), it just restructures the directories to allow for use in a standard Go environment, that is, a global GOPATH. It also makes use of the vendor/ directory to support the included dependencies. Most gophers set their GOPATH in their shell profile, and optionally add $GOPATH/bin to their PATH. This results in:

First time use:

# fetch github.com/twitchyliquid64/subnet into GOPATH/src/github.com/twitchyliquid64/subnet
# and compile the target main package into GOPATH/bin/subnet
$ go get github.com/twitchyliquid64/subnet
# with $GOPATH/bin in our PATH, we can then
$ subnet --help

Development:

$ cd $GOPATH/src/github.com/twitchyliquid64/subnet
# hack away....
$ go install
# compiled to GOPATH/bin/subnet
$ subnet --help
twitchyliquid64 commented 6 years ago

This is awesome, thanks!

I'm not sure how to use this PR interface or exactly what the etiquette is, but I noticed the commit you have so far deletes a bunch of code (presumably to move it to the correct path) but doesn't add it back anywhere (4 lines added, ~2k lines deleted)? I guess theres another commit coming and I should sit-tight?

jpillora commented 6 years ago

Ah yes, my mistake. The .gitignore had /subnet in there. I should have caught that! Now "Files Changed" tab is mostly: File renamed without changes.. A few notes:

(I did a git push --force to keep the history a bit cleaner)