MCPcopy Index your code
hub / github.com/cli/cli / IsBinaryContents

Function IsBinaryContents

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

Source from the content-addressed store, hash-verified

211}
212
213func IsBinaryContents(contents []byte) bool {
214 isBinary := true
215 for mime := mimetype.Detect(contents); mime != nil; mime = mime.Parent() {
216 if mime.Is("text/plain") {
217 isBinary = false
218 break
219 }
220 }
221 return isBinary
222}
223
224func PromptGists(prompter prompter.Prompter, client *http.Client, host string, cs *iostreams.ColorScheme) (gist *Gist, err error) {
225 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