MCPcopy Create free account
hub / github.com/go-pg/pg / appendString2

Function appendString2

types/append.go:151–174  ·  view source on GitHub ↗
(b []byte, s string, flags int)

Source from the content-addressed store, hash-verified

149}
150
151func appendString2(b []byte, s string, flags int) []byte {
152 b = append(b, '"')
153 for _, c := range s {
154 if c == '\000' {
155 continue
156 }
157
158 switch c {
159 case '\'':
160 if hasFlag(flags, quoteFlag) {
161 b = append(b, '\'')
162 }
163 b = append(b, '\'')
164 case '"':
165 b = append(b, '\\', '"')
166 case '\\':
167 b = append(b, '\\', '\\')
168 default:
169 b = appendRune(b, c)
170 }
171 }
172 b = append(b, '"')
173 return b
174}
175
176func appendRune(b []byte, r rune) []byte {
177 if r < utf8.RuneSelf {

Callers 3

appendSliceStringFunction · 0.85
appendMapStringStringFunction · 0.85
AppendStringFunction · 0.85

Calls 2

appendRuneFunction · 0.85
hasFlagFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…