MCPcopy Create free account
hub / github.com/UiPath/uipathcli / Data

Method Data

utils/stream/file_stream.go:35–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35func (s FileStream) Data() (io.ReadCloser, error) {
36 file, err := os.Open(s.path)
37 if err != nil && errors.Is(err, os.ErrNotExist) {
38 return nil, fmt.Errorf("File '%s' not found", s.path)
39 }
40 if err != nil {
41 return nil, fmt.Errorf("Error reading file '%s': %w", s.path, err)
42 }
43 return file, nil
44}
45
46func NewFileStream(path string) *FileStream {
47 return &FileStream{

Callers 2

TestFileStreamDataFunction · 0.95

Calls 1

OpenMethod · 0.80

Tested by 2

TestFileStreamDataFunction · 0.76