opentofu/internal/earlyconfig/module.go
Martin Atkins 8ca1fcec51 internal/earlyconfig: Liberal config parsing for init
This is an alternative to the full config loader in the "configs" package
that is good for "early" use-cases like "terraform init", where we want
to find out what our dependencies are without getting tripped up on any
other errors that might be present.
2019-01-14 11:33:21 -08:00

14 lines
367 B
Go

package earlyconfig
import (
"github.com/hashicorp/terraform-config-inspect/tfconfig"
"github.com/hashicorp/terraform/tfdiags"
)
// LoadModule loads some top-level metadata for the module in the given
// directory.
func LoadModule(dir string) (*tfconfig.Module, tfdiags.Diagnostics) {
mod, diags := tfconfig.LoadModule(dir)
return mod, wrapDiagnostics(diags)
}