MCPcopy Index your code
hub / github.com/Shopify/go-lua / flags

Function flags

io.go:175–196  ·  view source on GitHub ↗
(m string)

Source from the content-addressed store, hash-verified

173}
174
175func flags(m string) (f int, err error) {
176 if len(m) > 0 && m[len(m)-1] == 'b' {
177 m = m[:len(m)-1]
178 }
179 switch m {
180 case "r":
181 f = os.O_RDONLY
182 case "r+":
183 f = os.O_RDWR
184 case "w":
185 f = os.O_WRONLY | os.O_CREATE | os.O_TRUNC
186 case "w+":
187 f = os.O_RDWR | os.O_CREATE | os.O_TRUNC
188 case "a":
189 f = os.O_WRONLY | os.O_CREATE | os.O_APPEND
190 case "a+":
191 f = os.O_RDWR | os.O_CREATE | os.O_APPEND
192 default:
193 err = os.ErrInvalid
194 }
195 return
196}
197
198var ioLibrary = []RegistryFunction{
199 {"close", close},

Callers 2

forceOpenFunction · 0.85
io.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected