opentofu/internal/earlyconfig
Martin Atkins 8405f46bc5 tfdiags: Expose the "extra information" concept from HCL
HCL's diagnostic model now includes the idea of "extra information" which
works by attaching an initially-opaque interface value to each diagnostic
and then asking callers to type-assert against that value to sniff for
particular interfaces in order to discover additional machine-readable
context about a certain diagnostic message.

This commit echoes that idea into our tfdiags API, for now only for
diagnostics that are backed by an hcl.Diagnostic. All other implementations
of the diagnostic interface just always return nil, which means they never
carry any "extra information".

As is typical for our wrapping abstraction, we have here also a modified
copy of HCL's helper function for conveniently probing a diagnostic for
information of a particular type, designed to work with our diagnostic
interface instead of HCL's concrete diagnostic type.
2022-06-23 13:52:23 -07:00
..
testdata/provider-reqs internal/getproviders: A new shared model for provider requirements 2020-03-27 09:01:32 -07:00
config_build.go addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
config_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
diagnostics.go tfdiags: Expose the "extra information" concept from HCL 2022-06-23 13:52:23 -07:00
doc.go internal/earlyconfig: Liberal config parsing for init 2019-01-14 11:33:21 -08:00
module.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00