MCPcopy
hub / github.com/dgraph-io/dgraph / SafeUTF8

Function SafeUTF8

x/x.go:154–156  ·  view source on GitHub ↗

SafeUTF8 sanitizes a string for OTLP export by replacing invalid UTF-8 sequences.

(s string)

Source from the content-addressed store, hash-verified

152
153// SafeUTF8 sanitizes a string for OTLP export by replacing invalid UTF-8 sequences.
154func SafeUTF8(s string) string {
155 return strings.ToValidUTF8(s, "?")
156}
157
158// ShouldCrash returns true if the error should cause the process to crash.
159func ShouldCrash(err error) bool {

Callers 9

SortOverNetworkFunction · 0.92
ProcessTaskOverNetworkFunction · 0.92
handleValuePostingsMethod · 0.92
handleUidPostingsMethod · 0.92
processTaskFunction · 0.92
handleRegexFunctionMethod · 0.92
handleCompareFunctionMethod · 0.92
handleMatchFunctionMethod · 0.92
ServeTaskMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected