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

Function read

io.go:117–134  ·  view source on GitHub ↗
(l *State, f *os.File, argIndex int)

Source from the content-addressed store, hash-verified

115}
116
117func read(l *State, f *os.File, argIndex int) int {
118 resultCount := 0
119 var err error
120 if argCount := l.Top() - 1; argCount == 0 {
121 // err = readLineHelper(l, f, true)
122 resultCount = argIndex + 1
123 } else {
124 // TODO
125 }
126 if err != nil {
127 return FileResult(l, err, "")
128 }
129 if err == io.EOF {
130 l.Pop(1)
131 l.PushNil()
132 }
133 return resultCount - argIndex
134}
135
136func readLine(l *State) int {
137 s := l.ToUserData(UpValueIndex(1)).(*stream)

Callers 2

readLineFunction · 0.85
io.goFile · 0.85

Calls 4

FileResultFunction · 0.85
TopMethod · 0.80
PopMethod · 0.80
PushNilMethod · 0.80

Tested by

no test coverage detected