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

Function ioFileHelper

io.go:61–75  ·  view source on GitHub ↗
(name, mode string)

Source from the content-addressed store, hash-verified

59}
60
61func ioFileHelper(name, mode string) Function {
62 return func(l *State) int {
63 if !l.IsNoneOrNil(1) {
64 if name, ok := l.ToString(1); ok {
65 forceOpen(l, name, mode)
66 } else {
67 toFile(l)
68 l.PushValue(1)
69 }
70 l.SetField(RegistryIndex, name)
71 }
72 l.Field(RegistryIndex, name)
73 return 1
74 }
75}
76
77func closeHelper(l *State) int {
78 s := toStream(l)

Callers 1

io.goFile · 0.85

Calls 7

forceOpenFunction · 0.85
toFileFunction · 0.85
IsNoneOrNilMethod · 0.80
ToStringMethod · 0.80
PushValueMethod · 0.80
SetFieldMethod · 0.80
FieldMethod · 0.80

Tested by

no test coverage detected