opentofu/tfdiags/simple_warning.go
Martin Atkins 8d100bfde9 tfdiags: Expose expression evaluation information from diagnostics
HCL diagnostics relating to expression evaluation include these, so this
is really just to pass that information through our Terraform-specific
diagnostics interface.
2018-10-18 17:12:01 -07:00

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
}