-
Notifications
You must be signed in to change notification settings - Fork 1k
Please add a flag to dep ensure
to write out a templated file based on current lock state
#1773
Comments
I missed this as well, but did you see if the $ dep ensure
$ dep status -f 'GO_TEMPLATE' |
Not sure -- @sdboyer and I were talking about this last week, and based on my understanding of dep it needed to be in Sam, can |
yep, I think it can. I'd have to double-check to be certain it covers all our needs, but that's certainly the kind of thing it was designed to do. |
Hi @sdboyer, Actually, it can't. It doesn't have the actual package information, source (if a fork), etc. |
Is the use case specifically Gazelle or broader than that? @sdboyer It does seem that |
My use case is for integrating with Bazel's Go rules in general, but I'm sure there are others who would like to parse the lock data using (for example) JSON, which can be done with only stdlib. |
Well, this is the data available to // BasicStatus contains all the information reported about a single dependency
// in the summary/list status output mode.
type BasicStatus struct {
ProjectRoot string
Children []string
Constraint gps.Constraint
Version gps.UnpairedVersion
Revision gps.Revision
Latest gps.Version
PackageCount int
hasOverride bool
hasError bool
} For example: $ dep status -f '{{printf "%+v\n\n" .}}'
&{ProjectRoot:github.com/akutz/gosync Children:[] Constraint:v0.1.0 Version:v0.1.0 Revision:94b0033d0b5fc254594c3174329c19356c2c4f63 Latest:v0.1.0 PackageCount:1 hasOverride:false hasError:false}
&{ProjectRoot:github.com/container-storage-interface/spec Children:[] Constraint:v0.2.0 Version:v0.2.0 Revision:35d9f9d77954980e449e52c3f3e43c21bd8171f5 Latest:v0.2.0 PackageCount:1 hasOverride:false hasError:false}
&{ProjectRoot:github.com/coreos/etcd Children:[] Constraint:v3.3.2 Version:v3.3.2 Revision:c9d46ab3799b7f2174268e75f72d01e6d6aac953 Latest:v3.3.2 PackageCount:7 hasOverride:false hasError:false} Information missing from a
There may be more data currently unavailable to |
Dep's generated gopkg.lock has very useful data for integration with larger build systems, but the TOML format can be difficult to consume from other tooling. It would be nice if
dep ensure
could take a template file intext/template
format, run it with the lock data, and output to a user-specified path.For example, this would simplify integration with Gazelle because
dep ensure
could directly generate Bazel repository rules that are in sync with the vendor dir.The text was updated successfully, but these errors were encountered: