code: func (l *State) ToGoFunction(index int) Function {
  	switch v := l.indexToValue(index).(type) {
  	case *goFunction:
  		return v.Function
  	case *goClosure:
  		return v.function
  	}
  	return nil
  }
docs: // ToGoFunction converts a value at index into a Go function.  That value
  // must be a Go function, otherwise it returns nil.
  //
  // http://www.lua.org/manual/5.2/manual.html#lua_tocfunction