code: func ToGoValue(lv lua.LValue, opt Option) interface{} {
  	switch v := lv.(type) {
  	case *lua.LNilType:
  		return nil
  	case lua.LBool:
  		return bool(v)
  	case lua.LString:
  		return string(v)
  	case lua.LNumber:
  		return float64(v)
  	case *lua.LTable:
  		maxn := v.MaxN()
  		if maxn == 0 { // table
  			ret := make(map[interface{}]interface{})
  			v.ForEach(func(key, value lua.LValue) {
  				keystr := fmt.Sprint(ToGoValue(key, opt))
  				ret[opt.NameFunc(keystr)] = ToGoValue(value, opt)
  			})
  			return ret
  		} else { // array
  			ret := make([]interface{}, 0, maxn)
  			for i := 1; i <= maxn; i++ {
  				ret = append(ret, ToGoValue(v.RawGetInt(i), opt))
  			}
  			return ret
  		}
  	default:
  		return v
  	}
  }
docs: // ToGoValue converts the given LValue to a Go object.