mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
21 lines
418 B
Go
21 lines
418 B
Go
// Copied from github.com/hashicorp/terraform/internal/lang/funcs
|
|
package funcs
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/zclconf/go-cty/cty"
|
|
)
|
|
|
|
func redactIfSensitive(value any, markses ...cty.ValueMarks) string {
|
|
if Has(cty.DynamicVal.WithMarks(markses...), MarkedSensitive) {
|
|
return "(sensitive value)"
|
|
}
|
|
switch v := value.(type) {
|
|
case string:
|
|
return fmt.Sprintf("%q", v)
|
|
default:
|
|
return fmt.Sprintf("%v", v)
|
|
}
|
|
}
|