]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/hashicorp/terraform/tfdiags/diagnostic_base.go
Merge branch 'fix_read_test' of github.com:alexandreFre/terraform-provider-statuscake
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / tfdiags / diagnostic_base.go
CommitLineData
107c1cdb
ND
1package tfdiags
2
3// diagnosticBase can be embedded in other diagnostic structs to get
4// default implementations of Severity and Description. This type also
5// has default implementations of Source and FromExpr that return no source
6// location or expression-related information, so embedders should generally
7// override those method to return more useful results where possible.
8type diagnosticBase struct {
9 severity Severity
10 summary string
11 detail string
12}
13
14func (d diagnosticBase) Severity() Severity {
15 return d.severity
16}
17
18func (d diagnosticBase) Description() Description {
19 return Description{
20 Summary: d.summary,
21 Detail: d.detail,
22 }
23}
24
25func (d diagnosticBase) Source() Source {
26 return Source{}
27}
28
29func (d diagnosticBase) FromExpr() *FromExpr {
30 return nil
31}