gen 命令

Help information: gopm gen -h or gopm help gen:

  1. NAME:
  2. gen - generate a gopmfile for current Go project
  3. USAGE:
  4. command gen [command options] [arguments...]
  5. DESCRIPTION:
  6. Command gen gets dependencies and generates a gopmfile
  7. gopm gen
  8. Make sure you run this command in the root path of a go project.
  9. OPTIONS:
  10. --tags apply build tags
  11. --local, -l generate local GOPATH directories
  12. --verbose, -v show process details

gopm gen

  • 功能:根据当前 Go 项目生成 gopmfile。
  • 说明:获取依赖并写入 gopmfile。
  • 示例:gopm gen

使用用例

我现在正在目录 $GOPATH/src/github.com/gogits/gogs 下,此时我需要生成一个 gopmfile:

  1. $ gopm gen
  2. $ cat .gopmfile

输出:

  1. [target]
  2. path = github.com/gogits/gogs
  3. [deps]
  4. github.com/beego/memcache = commit:2aea774416
  5. github.com/beego/redigo = commit:856744a0d5
  6. github.com/Unknwon/cae = commit:2e70a1351b
  7. github.com/Unknwon/com = commit:2cbcbc6916
  8. github.com/Unknwon/goconfig = commit:0f8d8dc1c0
  9. github.com/Unknwon/i18n = commit:47baeff8d0
  10. github.com/Unknwon/macaron =
  11. github.com/codegangsta/cli = commit:7381bc4e62
  12. github.com/go-sql-driver/mysql = commit:8111ee3ec3
  13. github.com/go-xorm/core = commit:750aae0fa5
  14. github.com/go-xorm/xorm = commit:2d8b3135b1
  15. github.com/gogits/gfm = commit:40f747a9c0
  16. github.com/gogits/oauth2 = commit:99cbec870a
  17. github.com/lib/pq = commit:b021d0ef20
  18. github.com/macaron-contrib/cache = commit:204d8e5137
  19. github.com/macaron-contrib/captcha =
  20. github.com/macaron-contrib/csrf =
  21. github.com/macaron-contrib/i18n =
  22. github.com/macaron-contrib/session =
  23. github.com/macaron-contrib/toolbox = commit:57127bcc89
  24. github.com/mattn/go-sqlite3 = commit:a80c27ba33
  25. github.com/nfnt/resize = commit:581d15cb53
  26. github.com/saintfish/chardet = commit:3af4cd4741
  27. [res]
  28. include = conf|etc|public|scripts|templates

有关如何书写包版本的信息,请阅读 gopmfile

选项

  • —tags:在列举依赖时应用构建 tags。
  • —verbose, -v:显示详细信息。