MCPcopy
hub / github.com/prometheus/client_golang / GetUnifiedDiffString

Function GetUnifiedDiffString

prometheus/internal/difflib.go:643–647  ·  view source on GitHub ↗

Like WriteUnifiedDiff but returns the diff a string.

(diff UnifiedDiff)

Source from the content-addressed store, hash-verified

641
642// Like WriteUnifiedDiff but returns the diff a string.
643func GetUnifiedDiffString(diff UnifiedDiff) (string, error) {
644 w := &bytes.Buffer{}
645 err := WriteUnifiedDiff(w, diff)
646 return w.String(), err
647}
648
649// Split a string on "\n" while preserving them. The output can be used
650// as input for UnifiedDiff and ContextDiff structures.

Callers 2

Calls 2

WriteUnifiedDiffFunction · 0.85
StringMethod · 0.45

Tested by 2