(content []byte)
| 423 | } |
| 424 | |
| 425 | func 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 | } |
no outgoing calls