MCPcopy
hub / github.com/cortesi/devd / Open

Method Open

fileserver/fileserver_test.go:507–514  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

505type fakeFS map[string]*fakeFileInfo
506
507func (fs fakeFS) Open(name string) (http.File, error) {
508 name = path.Clean(name)
509 f, ok := fs[name]
510 if !ok {
511 return nil, os.ErrNotExist
512 }
513 return &fakeFile{ReadSeeker: strings.NewReader(f.contents), fi: f, path: name}, nil
514}
515
516func TestNotFoundOverride(t *testing.T) {
517 defer afterTest(t)

Callers 6

mainFunction · 0.45
TestDirJoinFunction · 0.45
TestEmptyDirOpenCWDFunction · 0.45
TestServeContentFunction · 0.45
serveNotFoundFileMethod · 0.45
serveFileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected