MCPcopy Create free account
hub / github.com/awslabs/amazon-eks-ami / ReadFile

Method ReadFile

nodeadm/internal/system/filesystem.go:69–78  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

67}
68
69func (f FakeFileSystem) ReadFile(name string) ([]byte, error) {
70 content, ok := f.Files[name]
71 if !ok {
72 return nil, os.ErrNotExist
73 }
74 if content == EmptyDirectoryMarker {
75 return nil, &os.PathError{Op: "read", Path: name, Err: os.ErrInvalid}
76 }
77 return []byte(content), nil
78}
79
80func (f FakeFileSystem) ReadDir(name string) ([]fs.DirEntry, error) {
81 name = strings.TrimSuffix(name, "/")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected