MCPcopy
hub / github.com/FiloSottile/age / writeGrease

Function writeGrease

plugin/client.go:493–506  ·  view source on GitHub ↗
(conn io.Writer)

Source from the content-addressed store, hash-verified

491}
492
493func writeGrease(conn io.Writer) (sent bool, err error) {
494 if mathrand.IntN(3) == 0 {
495 return false, nil
496 }
497 s := &format.Stanza{Type: fmt.Sprintf("grease-%x", mathrand.Int())}
498 for i := 0; i < mathrand.IntN(3); i++ {
499 s.Args = append(s.Args, fmt.Sprintf("%d", mathrand.IntN(100)))
500 }
501 if mathrand.IntN(2) == 0 {
502 s.Body = make([]byte, mathrand.IntN(100))
503 rand.Read(s.Body)
504 }
505 return true, s.Marshal(conn)
506}

Callers 4

RecipientV1Method · 0.85
IdentityV1Method · 0.85
WrapWithLabelsMethod · 0.85
UnwrapMethod · 0.85

Calls 2

MarshalMethod · 0.95
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…