clowwindy/shadowsocks-go — pull request #2 by cyfdecyf (2012-12-09 08:36:56+00:00)
Title: Reorganize file layout.

It's better to follow the conventions on setting `GOPATH` and choosing import path as stated in [How to Write Go Code](http://golang.org/doc/code.html). One benefit is that it's easier for the `go` command to fetch and install packages and binaries.

As this project contains one package and two executables, I guess it's better to choose an import path like `github.com//shadowsocks-go`.

This commit does the following:

- Move the shadowsocks package source into `shadowsocks-go/shadowsocks`
- So the package can be imported as `github.com//shadowsocks-go/shadowsocks`
- With the original organization, it's `github.com//shadowsocks-go/src/shadowsocks` which looks a little bit weird
- Move the local and server executable source code into `shadossocks-go/cmd` directory, and append the `shadowsocks` prefix
- Changed the shadowsocks package import statement in `local.go` and `server.go` to use the new path

With this change, shadowsocks can be easily installed with `go get`

go get github.com//shadowsocks-go/cmd/shadowsocks-server
go get github.com//shadowsocks-go/cmd/shadowsocks-local

Others who want to use the shadowsocks package can install it with

go get github.com//shadowsocks-go/shadowsocks

`go build` and `go install` also works under each subdirectory.

It's not possible (or maybe just difficult) to build shadowsocks inside it's own directory with this setting. But distribution should still be easy as go uses static linking and the executable itself is enough.