MCPcopy Create free account
hub / github.com/WICG/webpackage / writeBundleToFile

Function writeBundleToFile

go/bundle/cmd/sign-bundle/signedexchange.go:45–53  ·  view source on GitHub ↗
(b *bundle.Bundle, path string)

Source from the content-addressed store, hash-verified

43}
44
45func writeBundleToFile(b *bundle.Bundle, path string) error {
46 fo, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
47 if err != nil {
48 return err
49 }
50 defer fo.Close()
51 _, err = b.WriteTo(fo)
52 return err
53}
54
55func addSignature(b *bundle.Bundle, signer *signature.Signer) error {
56 for _, e := range b.Exchanges {

Callers 1

SignExchangesFunction · 0.85

Calls 1

WriteToMethod · 0.45

Tested by

no test coverage detected