MCPcopy Create free account
hub / github.com/google/pprof / escapeForDot

Function escapeForDot

internal/graph/dotgraph.go:492–494  ·  view source on GitHub ↗

escapeForDot escapes double quotes and backslashes, and replaces Graphviz's "center" character (\n) with a left-justified character. See https://graphviz.org/docs/attr-types/escString/ for more info.

(str string)

Source from the content-addressed store, hash-verified

490// "center" character (\n) with a left-justified character.
491// See https://graphviz.org/docs/attr-types/escString/ for more info.
492func escapeForDot(str string) string {
493 return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(str, `\`, `\\`), `"`, `\"`), "\n", `\l`)
494}

Callers 5

addLegendMethod · 0.85
addNodeMethod · 0.85
addEdgeMethod · 0.85
multilinePrintableNameFunction · 0.85
escapeAllForDotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…