We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a42bb0d commit e145dbbCopy full SHA for e145dbb
conv/values.go
@@ -566,6 +566,15 @@ func StringToStringValue(s string) types.String {
566
return types.String{Value: s}
567
}
568
569
+// BytesToStringValue takes a byte slice and wraps it as a types.String. If the provided slice is `nil`, then the
570
+// resulting String type will be marked as "null".
571
+func BytesToStringValue(b []byte) types.String {
572
+ if b == nil {
573
+ return types.String{Null: true}
574
+ }
575
+ return StringToStringValue(string(b))
576
+}
577
+
578
// StringPtrToStringValue takes a *string and wraps it up as a types.String
579
// If the go value is nil, Null will be true on the outgoing attr.Value type
580
func StringPtrToStringValue(s *string) types.String {
0 commit comments