MCPcopy
hub / github.com/charmbracelet/skate / printFromKV

Function printFromKV

main.go:377–392  ·  view source on GitHub ↗
(pf string, vs ...[]byte)

Source from the content-addressed store, hash-verified

375}
376
377func printFromKV(pf string, vs ...[]byte) {
378 nb := "(omitted binary data)"
379 fvs := make([]interface{}, 0)
380 isatty := term.IsTerminal(int(os.Stdin.Fd())) //nolint: gosec
381 for _, v := range vs {
382 if isatty && !showBinary && !utf8.Valid(v) {
383 fvs = append(fvs, nb)
384 } else {
385 fvs = append(fvs, string(v))
386 }
387 }
388 fmt.Printf(pf, fvs...)
389 if isatty && !strings.HasSuffix(pf, "\n") {
390 fmt.Println()
391 }
392}
393
394func keyParser(k string) ([]byte, string, error) {
395 var key, db string

Callers 2

getFunction · 0.85
listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected