Skip to content

Instantly share code, notes, and snippets.

@paultyng
Last active September 10, 2018 09:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paultyng/7b93fc3705f1fd192abd52a7f60b7c94 to your computer and use it in GitHub Desktop.
Save paultyng/7b93fc3705f1fd192abd52a7f60b7c94 to your computer and use it in GitHub Desktop.
Gopkg.lock to vendor.json - dep to govendor
# tomljson from https://github.com/pelletier/go-toml
tomljson Gopkg.lock \
| jq '{ comment: "", ignore: "test", package: [.projects[] | . as $project | .packages[] | { path: ($project.name + if . == "." then "" else ("/" + .) end), revision: $project.revision } + if $project.version then { version: $project.version, versionExact: $project.version } else {} end], rootPath: "github.com/..." }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment