MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / readAll

Function readAll

apps/server/internal/httpserver/server.go:1035–1050  ·  view source on GitHub ↗
(f fs.File)

Source from the content-addressed store, hash-verified

1033}
1034
1035func readAll(f fs.File) ([]byte, error) {
1036 buf := make([]byte, 0, 4*1024)
1037 tmp := make([]byte, 4*1024)
1038 for {
1039 n, err := f.Read(tmp)
1040 if n > 0 {
1041 buf = append(buf, tmp[:n]...)
1042 }
1043 if err != nil {
1044 if err.Error() == "EOF" {
1045 return buf, nil
1046 }
1047 return nil, err
1048 }
1049 }
1050}
1051
1052// injectBasePathHint splices a `<meta name="zn-base-path" ...>` tag into
1053// the SPA shell so the bundled JS can route API calls through the

Callers 1

serveIndexHTMLMethod · 0.85

Calls 2

appendFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected