dongyan8896 2013-08-28 06:54
浏览 63

相当于Golang Requirements.txt

Coming from a python/django world, it'd be great to have something like a requirements.txt equivalent for go/revel. How can I do this? I know I can just write a requirements.txt file and then do something like

cat reqiurements.txt | xargs go get

But what if my requirements ALSO have requirements? The above command would attempt to "go get" them, and then they'd fail to build, since I don't have those requirements installed.

Is there something I'm missing?

  • 写回答

2条回答 默认 最新

  • douyan6548 2013-08-28 07:50
    关注

    The command go get does exactly what you need: It finds all dependencies and downloads and installs the missing ones. Focus on "all": go get really traverses your dependency graph.

    Have a look at the documentation:

    http://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies

    The Go documentation is really clean, short and well written. I would recommend always to have a look at the documentation first before making assumptions which are based on experience with other tools or tool-chains.

    评论

报告相同问题?