{"id":13413689,"url":"https://github.com/tools/godep","last_synced_at":"2025-10-20T16:19:48.278Z","repository":{"id":38050831,"uuid":"9787757","full_name":"tools/godep","owner":"tools","description":"dependency tool for go","archived":true,"fork":false,"pushed_at":"2018-04-12T22:30:56.000Z","size":726,"stargazers_count":5528,"open_issues_count":79,"forks_count":451,"subscribers_count":140,"default_branch":"master","last_synced_at":"2025-08-03T08:24:56.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://godoc.org/github.com/tools/godep","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tools.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-01T07:55:35.000Z","updated_at":"2025-06-30T18:24:19.000Z","dependencies_parsed_at":"2022-08-29T11:20:49.549Z","dependency_job_id":null,"html_url":"https://github.com/tools/godep","commit_stats":null,"previous_names":["kr/godep"],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/tools/godep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tools%2Fgodep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tools%2Fgodep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tools%2Fgodep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tools%2Fgodep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tools","download_url":"https://codeload.github.com/tools/godep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tools%2Fgodep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280120073,"owners_count":26275620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:46.514Z","updated_at":"2025-10-20T16:19:48.002Z","avatar_url":"https://github.com/tools.png","language":"Go","readme":"# Godep - Archived\n\nPlease use [dep](https://github.com/golang/dep) or another tool instead.\n\nThe rest of this readme is preserved for those that may still need its contents.\n\n[![Build Status](https://travis-ci.org/tools/godep.svg)](https://travis-ci.org/tools/godep)\n\n[![GoDoc](https://godoc.org/github.com/tools/godep?status.svg)](https://godoc.org/github.com/tools/godep)\n\ngodep helps build packages reproducibly by fixing their dependencies.\n\nThis tool assumes you are working in a standard Go workspace, as described [here](http://golang.org/doc/code.html). We\nexpect godep to build on Go 1.4* or newer, but you can use it on any project that works with Go 1 or newer.\n\nPlease check the [FAQ](FAQ.md) if you have a question.\n\n## Golang Dep\n\nThe Go community now has the [dep](https://github.com/golang/dep) project to\nmanage dependencies. Please consider trying to migrate from Godep to dep. If there\nis an issue preventing you from migrating please file an issue with dep so the\nproblem can be corrected. Godep will continue to be supported for some time but\nis considered to be in a state of support rather than active feature development.\n\n## Install\n\n```console\ngo get github.com/tools/godep\n```\n\n## How to use godep with a new project\n\nAssuming you've got everything working already, so you can build your project\nwith `go install` and test it with `go test`, it's one command to start using:\n\n```console\ngodep save\n```\n\nThis will save a list of dependencies to the file `Godeps/Godeps.json` and copy\ntheir source code into `vendor/` (or `Godeps/_workspace/` when using older\nversions of Go). Godep does **not copy**:\n\n- files from source repositories that are not tracked in version control.\n- `*_test.go` files.\n- `testdata` directories.\n- files outside of the go packages.\n\nGodep does not process the imports of `.go` files with either the `ignore`\nor `appengine` build tags.\n\nTest files and testdata directories can be saved by adding `-t`.\n\nRead over the contents of `vendor/` and make sure it looks reasonable. Then\ncommit the `Godeps/` and `vendor/` directories to version control.\n\n## The deprecated `-r` flag\n\nFor older versions of Go, the `-r` flag tells save to automatically rewrite\npackage import paths. This allows your code to refer directly to the copied\ndependencies in `Godeps/_workspace`. So, a package C that depends on package\nD will actually import `C/Godeps/_workspace/src/D`. This makes C's repo\nself-contained and causes `go get` to build C with the right version of all\ndependencies.\n\nIf you don't use `-r`, when using older version of Go, then in order to use the\nfixed dependencies and get reproducible builds, you must make sure that **every\ntime** you run a Go-related command, you wrap it in one of these two ways:\n\n- If the command you are running is just `go`, run it as `godep go ...`, e.g.\n  `godep go install -v ./...`\n- When using a different command, set your `$GOPATH` using `godep path` as\n  described below.\n\n`-r` isn't necessary with go1.6+ and isn't allowed.\n\n## Additional Operations\n\n### Restore\n\nThe `godep restore` installs the\npackage versions specified in `Godeps/Godeps.json` to your `$GOPATH`. This\nmodifies the state of packages in your `$GOPATH`. NOTE: `godep restore` leaves\ngit repositories in a detached state. `go1.6`+ no longer checks out the master\nbranch when doing a `go get`, see [here](https://github.com/golang/go/commit/42206598671a44111c8f726ad33dc7b265bdf669).\n\n\u003e If you run `godep restore` in your main `$GOPATH` `go get -u` will fail on packages that are behind master.\n\nPlease see the [FAQ](https://github.com/tools/godep/blob/master/FAQ.md#should-i-use-godep-restore) section about restore.\n\n### Edit-test Cycle\n\n1. Edit code\n1. Run `godep go test`\n1. (repeat)\n\n### Add a Dependency\n\nTo add a new package foo/bar, do this:\n\n1. Run `go get foo/bar`\n1. Edit your code to import foo/bar.\n1. Run `godep save` (or `godep save ./...`).\n\n### Update a Dependency\n\nTo update a package from your `$GOPATH`, do this:\n\n1. Run `go get -u foo/bar`\n1. Run `godep update foo/bar`.\n\nYou can use the `...` wildcard, for example `godep update foo/...`. Before comitting the change, you'll probably want to\ninspect the changes to Godeps, for example with `git diff`, and make sure it looks reasonable.\n\n## Multiple Packages\n\nIf your repository has more than one package, you're probably accustomed to\nrunning commands like `go test ./...`, `go install ./...`, and `go fmt ./...`.\nSimilarly, you should run `godep save ./...` to capture the dependencies of all\npackages in your application.\n\n## File Format\n\nGodeps is a json file with the following structure:\n\n```go\ntype Godeps struct {\n  ImportPath   string\n  GoVersion    string   // Abridged output of 'go version'.\n  GodepVersion string   // Abridged output of 'godep version'\n  Packages     []string // Arguments to godep save, if any.\n  Deps         []struct {\n    ImportPath string\n    Comment    string // Description of commit, if present.\n    Rev        string // VCS-specific commit ID.\n  }\n}\n```\n\nExample Godeps:\n\n```json\n{\n  \"ImportPath\": \"github.com/kr/hk\",\n  \"GoVersion\": \"go1.6\",\n  \"Deps\": [\n    {\n      \"ImportPath\": \"code.google.com/p/go-netrc/netrc\",\n      \"Rev\": \"28676070ab99\"\n    },\n    {\n      \"ImportPath\": \"github.com/kr/binarydist\",\n      \"Rev\": \"3380ade90f8b0dfa3e363fd7d7e941fa857d0d13\"\n    }\n  ]\n}\n```\n\n## Migrating to vendor/\n\nGodep supports the Go 1.5+ vendor/\n[experiment](https://github.com/golang/go/commit/183cc0cd41f06f83cb7a2490a499e3f9101befff)\nutilizing the same environment variable that the go tooling itself supports\n(`GO15VENDOREXPERIMENT`).\n\ngodep mostly works the same way as the `go` command line tool. If you have go\n1.5.X and set `GO15VENDOREXPERIMENT=1` or have go1.6.X (or devel) `vendor/`\nis enabled. **Unless** you already have a `Godeps/_workspace`. This is a safety\nfeature and godep warns you about this.\n\nWhen `vendor/` is enabled godep will write the vendored code into the top level\n`./vendor/` directory. A `./Godeps/Godeps.json` file is created to track\nthe dependencies and revisions. `vendor/` is not compatible with rewrites.\n\nThere is currently no automated migration between the old Godeps workspace and\nthe vendor directory, but the following steps should work:\n\n```term\n# just to be safe\n$ unset GO15VENDOREXPERIMENT\n\n# restore currently vendored deps to the $GOPATH\n$ godep restore\n\n# The next line is only needed to automatically undo rewritten imports that were\n# created with godep save -r.\n$ godep save -r=false \u003cpkg spec\u003e\n\n# Remove the old Godeps folder\n$ rm -rf Godeps\n\n# If on go1.5.X to enable `vendor/`\n$ export GO15VENDOREXPERIMENT=1\n\n# re-analyze deps and save to `vendor/`.\n$ godep save \u003cpkg spec\u003e\n\n# Add the changes to your VCS\n$ git add -A . ; git commit -am \"Godep workspace -\u003e vendor/\"\n\n# You should see your Godeps/_workspace/src files \"moved\" to vendor/.\n```\n\n## Releasing\n\n1. Increment the version in `version.go`.\n1. Tag the commit with the same version number.\n1. Update `Changelog.md`.\n","funding_links":[],"categories":["Uncategorized","Misc","Go","Package Management","包管理","Go语言包管理","Go Compile Helpers","Relational Databases","\u003cspan id=\"包管理-package-management\"\u003e包管理 Package Management\u003c/span\u003e"],"sub_categories":["Uncategorized","HTTP Clients","Advanced Console UIs","ORM","Contents","OpenGL","交流","HTTP客户端","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftools%2Fgodep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftools%2Fgodep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftools%2Fgodep/lists"}