Skip to content

Instantly share code, notes, and snippets.

@take-cheeze
Last active May 2, 2018 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save take-cheeze/dd0e2710ff7a4794065c4a4d953dbcc1 to your computer and use it in GitHub Desktop.
Save take-cheeze/dd0e2710ff7a4794065c4a4d953dbcc1 to your computer and use it in GitHub Desktop.
dep download作り

リモートのインポートパスのルール: https://golang.org/cmd/go/#hdr-Remote_import_paths

HTTPで取得して meta[name="go-imports"] から、リポジトリ情報取得 https://github.com/golang/go/blob/178307c3a72a9da3d731fecf354630761d6b246c/src/cmd/go/internal/get/discovery.go#L31-L65

HTTPで取得する時は、 ?go-get=1 をつけるのを忘れずに https://github.com/golang/go/blob/178307c3a72a9da3d731fecf354630761d6b246c/src/cmd/go/internal/web/http.go#L82

depでのgitとかのルールはここら辺: https://github.com/golang/dep/blob/338675da19c738092aea0be66bfaa591810feb56/gps/deduce.go

githubだとコミットハッシュから直接tarballがダウンロード可能: https://developer.github.com/v3/repos/contents/#get-archive-link

lockファイルの仕様: https://github.com/golang/dep/blob/132ea90a93d9bde7a328f84413b55d365609834b/lock.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment