MCPcopy Create free account
hub / github.com/driangle/taskmd / isBinary

Function isBinary

apps/cli/internal/taskcontext/resolve.go:290–301  ·  view source on GitHub ↗

isBinary reports whether data looks like binary content. It checks for null bytes in the first 8KB, which is the same heuristic git uses.

(data []byte)

Source from the content-addressed store, hash-verified

288// isBinary reports whether data looks like binary content.
289// It checks for null bytes in the first 8KB, which is the same heuristic git uses.
290func isBinary(data []byte) bool {
291 check := data
292 if len(check) > 8192 {
293 check = check[:8192]
294 }
295 for _, b := range check {
296 if b == 0 {
297 return true
298 }
299 }
300 return false
301}
302
303// countLines returns the number of lines in content, handling trailing newlines correctly.
304func countLines(content string) int {

Callers 1

inlineContentsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected