MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / shouldEscapeFileContent

Function shouldEscapeFileContent

cli/internal/specs/v0/spec_reader.go:425–437  ·  view source on GitHub ↗
(content []byte)

Source from the content-addressed store, hash-verified

423}
424
425func shouldEscapeFileContent(content []byte) bool {
426 if !bytes.ContainsAny(content, "\n\r") {
427 return false
428 }
429 if json.Valid(content) {
430 return true
431 }
432 block, _ := pem.Decode(content)
433
434 // if block == nil then content is a valid PEM block and should return true
435 // if block != nil then content is not a valid PEM block and should return false
436 return block != nil
437}

Callers 2

expandFileConfigFunction · 0.85

Calls

no outgoing calls

Tested by 1