MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / isStringSafe

Method isStringSafe

logger/formatter_json.go:181–188  ·  view source on GitHub ↗

isStringSafe checks if a string is safe to append without escaping.

(val string)

Source from the content-addressed store, hash-verified

179
180// isStringSafe checks if a string is safe to append without escaping.
181func (s *formatterJSON) isStringSafe(val string) bool {
182 for i := range len(val) {
183 if b := val[i]; b >= utf8.RuneSelf || !jsonSafeSet[b] {
184 return false
185 }
186 }
187 return true
188}
189
190// appendTime appends a time value to the buffer.
191func (s *formatterJSON) appendTime(val time.Time) {

Callers 1

appendStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected