MCPcopy Create free account
hub / github.com/cli/cli / IsBinaryContents

Function IsBinaryContents

pkg/cmd/gist/shared/shared.go:217–226  ·  view source on GitHub ↗
(contents []byte)

Source from the content-addressed store, hash-verified

215}
216
217func IsBinaryContents(contents []byte) bool {
218 isBinary := true
219 for mime := mimetype.Detect(contents); mime != nil; mime = mime.Parent() {
220 if mime.Is("text/plain") {
221 isBinary = false
222 break
223 }
224 }
225 return isBinary
226}
227
228func PromptGists(prompter prompter.Prompter, client *http.Client, host string, cs *iostreams.ColorScheme) (gist *Gist, err error) {
229 gists, err := ListGists(client, host, 10, nil, false, "all")

Callers 5

viewRunFunction · 0.92
processFilesFunction · 0.92
editRunFunction · 0.92
getFilesToAddFunction · 0.92
TestIsBinaryContentsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsBinaryContentsFunction · 0.68