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

Function IsBinaryContents

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

Source from the content-addressed store, hash-verified

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