goose: remove optional directive

This introduces some short-term pain in practice, but I aim to fix that
with the goose.Value directive.

Reviewed-by: Tuo Shan <shantuo@google.com>
This commit is contained in:
Ross Light
2018-04-26 14:23:06 -04:00
parent cfc6111ea5
commit 3345599aaf
20 changed files with 11 additions and 197 deletions

View File

@@ -198,9 +198,6 @@ func gather(info *goose.Info, key goose.ProviderSetID) (_ []outGroup, imports ma
// Try to see if any args haven't been visited.
allPresent := true
for _, arg := range p.Args {
if arg.Optional {
continue
}
if inputVisited.At(arg.Type) == nil {
allPresent = false
}
@@ -208,9 +205,6 @@ func gather(info *goose.Info, key goose.ProviderSetID) (_ []outGroup, imports ma
if !allPresent {
stk = append(stk, curr)
for _, arg := range p.Args {
if arg.Optional {
continue
}
if inputVisited.At(arg.Type) == nil {
stk = append(stk, arg.Type)
}
@@ -222,9 +216,6 @@ func gather(info *goose.Info, key goose.ProviderSetID) (_ []outGroup, imports ma
in := new(typeutil.Map)
in.SetHasher(hash)
for _, arg := range p.Args {
if arg.Optional {
continue
}
i := inputVisited.At(arg.Type).(int)
if i == -1 {
in.Set(arg.Type, true)