mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
05caff2ca3
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
34 lines
818 B
Go
34 lines
818 B
Go
package tfdiags
|
|
|
|
// diagnosticBase can be embedded in other diagnostic structs to get
|
|
// default implementations of Severity and Description. This type also
|
|
// has default implementations of Source and FromExpr that return no source
|
|
// location or expression-related information, so embedders should generally
|
|
// override those method to return more useful results where possible.
|
|
type diagnosticBase struct {
|
|
severity Severity
|
|
summary string
|
|
detail string
|
|
address string
|
|
}
|
|
|
|
func (d diagnosticBase) Severity() Severity {
|
|
return d.severity
|
|
}
|
|
|
|
func (d diagnosticBase) Description() Description {
|
|
return Description{
|
|
Summary: d.summary,
|
|
Detail: d.detail,
|
|
Address: d.address,
|
|
}
|
|
}
|
|
|
|
func (d diagnosticBase) Source() Source {
|
|
return Source{}
|
|
}
|
|
|
|
func (d diagnosticBase) FromExpr() *FromExpr {
|
|
return nil
|
|
}
|