Giter Site home page Giter Site logo

Comments (3)

cyfdecyf avatar cyfdecyf commented on June 9, 2024

请参考 How to Write Go Code,一定要看完 workspaces 一节。

GOPATH 对应的是一个 workspace,其中可以包含很多项目,项目可以来自 github, google code 等地。

可以设置一个目录为 GOPATH,然后执行

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

执行完之后看下 $GOPATH 下的目录结构也就明白了。

from shadowsocks-go.

yaotian avatar yaotian commented on June 9, 2024

这个项目不是直接clone下来吗?至少大多数人是这么做的。clone下来后看有makefile, 就直接make. 遇到错误。返回来项目目录,发现没有src. 因为通常是根据src目录来设置GOPATH...

from shadowsocks-go.

cyfdecyf avatar cyfdecyf commented on June 9, 2024

go get 才是推荐做法,它会用 git 等代码管理工具将依赖的 pkg 一起 clone 下来,自己 clone 需要手动解决依赖问题。

Makefile 是因为这个项目有多个 binary,我为了方便测试才写的。如果你不想修改代码,不建议使用。

如果还是想自己 clone,还是先弄清楚 GOPATH 的用处。src 是在 GOPATH 下的,项目代码不应该有。Go 的惯例是 GOPATH/{src,bin,pkg} 下存放所有非官方的代码和编译出的二进制文件。

自己 clone 的步骤

  1. 设置 GOPATH,这个应该是安装完 Go 之后马上要做的事
  2. mkdir $GOPATH/src/github.com/shadowsocks
  3. clone shadowsocks-go 到这个目录
  4. 照上面步骤 clone github.com/cyfdecyf/leakybuf 这个项目,执行 go install

这样之后才能使用 make。

from shadowsocks-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.