Commit Graph

12 Commits

Author SHA1 Message Date
Ross Light
e2c2d40041 gcp: set up goose providers
Obsoletes the demos/goose directory by applying it to the rest of the
tree.

Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:56 -08:00
Ross Light
89371e16bd goose: use same directive parsing code during inject
Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:56 -08:00
Ross Light
479a501c08 goose: add optional provider inputs
Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
c594f05699 goose: strip vendor from generated import paths
This allows goose to work more gracefully in a vgo setting.

Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
9af97a68c4 goose: split into multiple files
No functional change, just to make future diffs easier.

Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
cb1853b1af goose: use readable variable names
Names are inferred from types most of the time, but have a fallback for
a non-named type. Names are now also disambiguated from symbols in the
same scope.

Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
50dbe5a65d goose: add a test for imports across packages
Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
b92ac73ae3 goose: read tests from testdata
Since tests are all written in terms of Go source, it makes tests easier
to write.  They still need to be arranged in a GOPATH for go build, but
tests that just call Generate can operate in-place because I've faked
the filesystem.

Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
c9506b42e5 goose: skip function body type-checking
Learn this one weird trick to make goose an order of magnitude faster!

Reviewed-by: Herbie Ong <herbie@google.com>
Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
34987b6bee goose: use function name as implicit provider set
Single-element provider sets are frequently useful enough to warrant
being a default.  Larger groupings within a package are less frequent.

Reviewed-by: Herbie Ong <herbie@google.com>
Reviewed-by: Tuo Shan <shantuo@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
4abf804032 goose: rename module to provider set
It is more descriptive of what it is, as well as avoids confusion with
Go modules in the versioning sense.

Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00
Ross Light
26c8618466 goose: dependency injection proof of concept
See documentation and demo for usage and known limitations.

Reviewed-by: Herbie Ong <herbie@google.com>
2018-11-12 14:09:55 -08:00