Lua 'end' expected (to close 'function' at line near '<eof>'
snippet in lua

Lua 'end' expected (to close 'function' at line near '<eof>'

user6529

-- check / get fuels
local function checkFuel()
  while turtle.getFuelLevel() == 0 do
   for k=0, 16, 1 do
     if turtle.refuel(i) then
       return
     end
   end
  return
  end
end