MCPcopy
hub / github.com/eddycjy/go-gin-example / Open

Function Open

pkg/file/file.go:59–66  ·  view source on GitHub ↗

Open a file according to a specific mode

(name string, flag int, perm os.FileMode)

Source from the content-addressed store, hash-verified

57
58// Open a file according to a specific mode
59func Open(name string, flag int, perm os.FileMode) (*os.File, error) {
60 f, err := os.OpenFile(name, flag, perm)
61 if err != nil {
62 return nil, err
63 }
64
65 return f, nil
66}
67
68// MustOpen maximize trying to open the file
69func MustOpen(fileName, filePath string) (*os.File, error) {

Callers 1

MustOpenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected