github.com/opentofu/opentofu@v1.7.1/internal/tfdiags/sourceless.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package tfdiags
     7  
     8  // Sourceless creates and returns a diagnostic with no source location
     9  // information. This is generally used for operational-type errors that are
    10  // caused by or relate to the environment where OpenTofu is running rather
    11  // than to the provided configuration.
    12  func Sourceless(severity Severity, summary, detail string) Diagnostic {
    13  	return diagnosticBase{
    14  		severity: severity,
    15  		summary:  summary,
    16  		detail:   detail,
    17  	}
    18  }