github.com/magodo/terraform@v0.11.12-beta1/tfdiags/simple_warning.go (about)

     1  package tfdiags
     2  
     3  type simpleWarning string
     4  
     5  var _ Diagnostic = simpleWarning("")
     6  
     7  // SimpleWarning constructs a simple (summary-only) warning diagnostic.
     8  func SimpleWarning(msg string) Diagnostic {
     9  	return simpleWarning(msg)
    10  }
    11  
    12  func (e simpleWarning) Severity() Severity {
    13  	return Warning
    14  }
    15  
    16  func (e simpleWarning) Description() Description {
    17  	return Description{
    18  		Summary: string(e),
    19  	}
    20  }
    21  
    22  func (e simpleWarning) Source() Source {
    23  	// No source information available for a native error
    24  	return Source{}
    25  }