mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 08:21:07 -06:00
8d100bfde9
HCL diagnostics relating to expression evaluation include these, so this is really just to pass that information through our Terraform-specific diagnostics interface.
31 lines
617 B
Go
31 lines
617 B
Go
package tfdiags
|
|
|
|
type simpleWarning string
|
|
|
|
var _ Diagnostic = simpleWarning("")
|
|
|
|
// SimpleWarning constructs a simple (summary-only) warning diagnostic.
|
|
func SimpleWarning(msg string) Diagnostic {
|
|
return simpleWarning(msg)
|
|
}
|
|
|
|
func (e simpleWarning) Severity() Severity {
|
|
return Warning
|
|
}
|
|
|
|
func (e simpleWarning) Description() Description {
|
|
return Description{
|
|
Summary: string(e),
|
|
}
|
|
}
|
|
|
|
func (e simpleWarning) Source() Source {
|
|
// No source information available for a simple warning
|
|
return Source{}
|
|
}
|
|
|
|
func (e simpleWarning) FromExpr() *FromExpr {
|
|
// Simple warnings are not expression-related
|
|
return nil
|
|
}
|