From 5751c281f6cc92fdf6e4110801642df0d9b706e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:34:49 +0000 Subject: [PATCH] Bump github.com/traefik/yaegi from 0.9.15 to 0.14.2 Bumps [github.com/traefik/yaegi](https://github.com/traefik/yaegi) from 0.9.15 to 0.14.2. - [Release notes](https://github.com/traefik/yaegi/releases) - [Changelog](https://github.com/traefik/yaegi/blob/master/.goreleaser.yml) - [Commits](https://github.com/traefik/yaegi/compare/v0.9.15...v0.14.2) --- updated-dependencies: - dependency-name: github.com/traefik/yaegi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../traefik/yaegi/internal/unsafe2/unsafe.go | 61 + vendor/github.com/traefik/yaegi/interp/ast.go | 88 +- .../github.com/traefik/yaegi/interp/build.go | 1 + vendor/github.com/traefik/yaegi/interp/cfg.go | 1037 +++++++---- .../traefik/yaegi/interp/debugger.go | 730 ++++++++ vendor/github.com/traefik/yaegi/interp/doc.go | 4 +- vendor/github.com/traefik/yaegi/interp/dot.go | 3 +- .../traefik/yaegi/interp/generic.go | 281 +++ vendor/github.com/traefik/yaegi/interp/gta.go | 183 +- .../github.com/traefik/yaegi/interp/interp.go | 539 +++--- vendor/github.com/traefik/yaegi/interp/op.go | 403 ++++- .../traefik/yaegi/interp/program.go | 202 +++ .../github.com/traefik/yaegi/interp/realfs.go | 21 + vendor/github.com/traefik/yaegi/interp/run.go | 1100 +++++++----- .../github.com/traefik/yaegi/interp/scope.go | 91 +- vendor/github.com/traefik/yaegi/interp/src.go | 40 +- .../github.com/traefik/yaegi/interp/type.go | 1563 ++++++++++++----- .../traefik/yaegi/interp/typecheck.go | 130 +- .../traefik/yaegi/interp/typestring.go | 40 + vendor/github.com/traefik/yaegi/interp/use.go | 252 +++ .../github.com/traefik/yaegi/interp/value.go | 223 +-- .../yaegi/stdlib/go1_15_debug_plan9obj.go | 31 - .../traefik/yaegi/stdlib/go1_15_go_parser.go | 30 - .../traefik/yaegi/stdlib/go1_15_hash.go | 73 - .../traefik/yaegi/stdlib/go1_15_image_draw.go | 65 - .../traefik/yaegi/stdlib/go1_15_os_signal.go | 21 - .../traefik/yaegi/stdlib/go1_15_testing.go | 84 - .../yaegi/stdlib/go1_16_debug_plan9obj.go | 31 - .../yaegi/stdlib/go1_16_encoding_binary.go | 57 - .../traefik/yaegi/stdlib/go1_16_go_parser.go | 30 - .../traefik/yaegi/stdlib/go1_16_hash.go | 73 - .../traefik/yaegi/stdlib/go1_16_image_draw.go | 65 - .../traefik/yaegi/stdlib/go1_16_testing.go | 84 - ...6_archive_tar.go => go1_18_archive_tar.go} | 5 +- ...6_archive_zip.go => go1_18_archive_zip.go} | 5 +- .../{go1_15_bufio.go => go1_18_bufio.go} | 5 +- .../{go1_15_bytes.go => go1_18_bytes.go} | 6 +- ...ress_bzip2.go => go1_18_compress_bzip2.go} | 5 +- ...ress_flate.go => go1_18_compress_flate.go} | 19 +- ...mpress_gzip.go => go1_18_compress_gzip.go} | 5 +- ...compress_lzw.go => go1_18_compress_lzw.go} | 9 +- ...mpress_zlib.go => go1_18_compress_zlib.go} | 10 +- ...ainer_heap.go => go1_18_container_heap.go} | 36 +- ...ainer_list.go => go1_18_container_list.go} | 5 +- ...ainer_ring.go => go1_18_container_ring.go} | 5 +- .../{go1_16_context.go => go1_18_context.go} | 24 +- .../{go1_16_crypto.go => go1_18_crypto.go} | 23 +- ..._15_crypto_aes.go => go1_18_crypto_aes.go} | 5 +- ...ypto_cipher.go => go1_18_crypto_cipher.go} | 41 +- ..._16_crypto_des.go => go1_18_crypto_des.go} | 5 +- ..._16_crypto_dsa.go => go1_18_crypto_dsa.go} | 5 +- ...crypto_ecdsa.go => go1_18_crypto_ecdsa.go} | 5 +- ...to_ed25519.go => go1_18_crypto_ed25519.go} | 5 +- ..._elliptic.go => go1_18_crypto_elliptic.go} | 14 +- ...6_crypto_hmac.go => go1_18_crypto_hmac.go} | 5 +- ..._15_crypto_md5.go => go1_18_crypto_md5.go} | 5 +- ...6_crypto_rand.go => go1_18_crypto_rand.go} | 5 +- ..._15_crypto_rc4.go => go1_18_crypto_rc4.go} | 5 +- ..._15_crypto_rsa.go => go1_18_crypto_rsa.go} | 5 +- ...5_crypto_sha1.go => go1_18_crypto_sha1.go} | 5 +- ...ypto_sha256.go => go1_18_crypto_sha256.go} | 5 +- ...ypto_sha512.go => go1_18_crypto_sha512.go} | 5 +- ...ypto_subtle.go => go1_18_crypto_subtle.go} | 5 +- ..._16_crypto_tls.go => go1_18_crypto_tls.go} | 10 +- ...5_crypto_x509.go => go1_18_crypto_x509.go} | 5 +- ...509_pkix.go => go1_18_crypto_x509_pkix.go} | 5 +- ...database_sql.go => go1_18_database_sql.go} | 23 +- ...river.go => go1_18_database_sql_driver.go} | 169 +- .../yaegi/stdlib/go1_18_debug_buildinfo.go | 22 + ...6_debug_dwarf.go => go1_18_debug_dwarf.go} | 21 +- ...o1_16_debug_elf.go => go1_18_debug_elf.go} | 7 +- ...6_debug_gosym.go => go1_18_debug_gosym.go} | 5 +- ...5_debug_macho.go => go1_18_debug_macho.go} | 12 +- ...{go1_16_debug_pe.go => go1_18_debug_pe.go} | 5 +- .../yaegi/stdlib/go1_18_debug_plan9obj.go | 33 + .../traefik/yaegi/stdlib/go1_18_embed.go | 18 + ...{go1_15_encoding.go => go1_18_encoding.go} | 17 +- ..._ascii85.go => go1_18_encoding_ascii85.go} | 5 +- ...coding_asn1.go => go1_18_encoding_asn1.go} | 5 +- ...ng_base32.go => go1_18_encoding_base32.go} | 5 +- ...ng_base64.go => go1_18_encoding_base64.go} | 5 +- ...ng_binary.go => go1_18_encoding_binary.go} | 37 +- ...encoding_csv.go => go1_18_encoding_csv.go} | 5 +- ...encoding_gob.go => go1_18_encoding_gob.go} | 15 +- ...encoding_hex.go => go1_18_encoding_hex.go} | 5 +- ...coding_json.go => go1_18_encoding_json.go} | 16 +- ...encoding_pem.go => go1_18_encoding_pem.go} | 5 +- ...encoding_xml.go => go1_18_encoding_xml.go} | 15 +- .../{go1_15_errors.go => go1_18_errors.go} | 5 +- .../{go1_15_expvar.go => go1_18_expvar.go} | 13 +- .../stdlib/{go1_16_flag.go => go1_18_flag.go} | 35 +- .../stdlib/{go1_16_fmt.go => go1_18_fmt.go} | 68 +- .../{go1_15_go_ast.go => go1_18_go_ast.go} | 76 +- ...{go1_15_go_build.go => go1_18_go_build.go} | 5 +- .../stdlib/go1_18_go_build_constraint.go | 49 + ...6_go_constant.go => go1_18_go_constant.go} | 21 +- .../{go1_15_go_doc.go => go1_18_go_doc.go} | 5 +- ...o1_16_go_format.go => go1_18_go_format.go} | 5 +- ...6_go_importer.go => go1_18_go_importer.go} | 5 +- .../traefik/yaegi/stdlib/go1_18_go_parser.go | 32 + ..._16_go_printer.go => go1_18_go_printer.go} | 5 +- ..._16_go_scanner.go => go1_18_go_scanner.go} | 5 +- ...{go1_15_go_token.go => go1_18_go_token.go} | 6 +- ...{go1_15_go_types.go => go1_18_go_types.go} | 90 +- .../traefik/yaegi/stdlib/go1_18_hash.go | 111 ++ ...hash_adler32.go => go1_18_hash_adler32.go} | 5 +- ..._16_hash_crc32.go => go1_18_hash_crc32.go} | 5 +- ..._15_hash_crc64.go => go1_18_hash_crc64.go} | 5 +- ...{go1_16_hash_fnv.go => go1_18_hash_fnv.go} | 5 +- ...hash_maphash.go => go1_18_hash_maphash.go} | 5 +- .../stdlib/{go1_15_html.go => go1_18_html.go} | 5 +- ...ml_template.go => go1_18_html_template.go} | 6 +- .../{go1_16_image.go => go1_18_image.go} | 59 +- ...6_image_color.go => go1_18_image_color.go} | 17 +- ...lette.go => go1_18_image_color_palette.go} | 5 +- .../traefik/yaegi/stdlib/go1_18_image_draw.go | 109 ++ ...o1_15_image_gif.go => go1_18_image_gif.go} | 5 +- ..._16_image_jpeg.go => go1_18_image_jpeg.go} | 14 +- ...o1_15_image_png.go => go1_18_image_png.go} | 18 +- ...ixarray.go => go1_18_index_suffixarray.go} | 5 +- .../stdlib/{go1_15_io.go => go1_18_io.go} | 177 +- .../traefik/yaegi/stdlib/go1_18_io_fs.go | 246 +++ ...o1_16_io_ioutil.go => go1_18_io_ioutil.go} | 5 +- .../stdlib/{go1_15_log.go => go1_18_log.go} | 6 +- ..._16_log_syslog.go => go1_18_log_syslog.go} | 5 +- .../stdlib/{go1_16_math.go => go1_18_math.go} | 14 +- ...{go1_15_math_big.go => go1_18_math_big.go} | 5 +- ...o1_16_math_bits.go => go1_18_math_bits.go} | 5 +- ..._16_math_cmplx.go => go1_18_math_cmplx.go} | 5 +- ...o1_16_math_rand.go => go1_18_math_rand.go} | 27 +- .../stdlib/{go1_16_mime.go => go1_18_mime.go} | 5 +- ..._multipart.go => go1_18_mime_multipart.go} | 14 +- ...able.go => go1_18_mime_quotedprintable.go} | 5 +- .../stdlib/{go1_15_net.go => go1_18_net.go} | 104 +- ...{go1_16_net_http.go => go1_18_net_http.go} | 77 +- ...net_http_cgi.go => go1_18_net_http_cgi.go} | 5 +- ...kiejar.go => go1_18_net_http_cookiejar.go} | 13 +- ...t_http_fcgi.go => go1_18_net_http_fcgi.go} | 5 +- ...ttptest.go => go1_18_net_http_httptest.go} | 5 +- ...ptrace.go => go1_18_net_http_httptrace.go} | 5 +- ...ttputil.go => go1_18_net_http_httputil.go} | 18 +- ...http_pprof.go => go1_18_net_http_pprof.go} | 5 +- ...{go1_16_net_mail.go => go1_18_net_mail.go} | 5 +- .../traefik/yaegi/stdlib/go1_18_net_netip.go | 36 + .../{go1_16_net_rpc.go => go1_18_net_rpc.go} | 35 +- ...c_jsonrpc.go => go1_18_net_rpc_jsonrpc.go} | 5 +- ...{go1_16_net_smtp.go => go1_18_net_smtp.go} | 6 +- ...t_textproto.go => go1_18_net_textproto.go} | 5 +- .../{go1_16_net_url.go => go1_18_net_url.go} | 5 +- .../stdlib/{go1_15_os.go => go1_18_os.go} | 78 +- .../traefik/yaegi/stdlib/go1_18_os_signal.go | 23 + .../{go1_16_os_user.go => go1_18_os_user.go} | 5 +- .../stdlib/{go1_16_path.go => go1_18_path.go} | 5 +- ...th_filepath.go => go1_18_path_filepath.go} | 6 +- .../{go1_16_reflect.go => go1_18_reflect.go} | 120 +- .../{go1_16_regexp.go => go1_18_regexp.go} | 5 +- ...gexp_syntax.go => go1_18_regexp_syntax.go} | 5 +- .../{go1_16_runtime.go => go1_18_runtime.go} | 14 +- ...ntime_debug.go => go1_18_runtime_debug.go} | 13 +- .../yaegi/stdlib/go1_18_runtime_metrics.go | 30 + ...ntime_pprof.go => go1_18_runtime_pprof.go} | 5 +- ...ntime_trace.go => go1_18_runtime_trace.go} | 5 +- .../stdlib/{go1_16_sort.go => go1_18_sort.go} | 24 +- .../{go1_15_strconv.go => go1_18_strconv.go} | 6 +- .../{go1_16_strings.go => go1_18_strings.go} | 7 +- .../stdlib/{go1_16_sync.go => go1_18_sync.go} | 14 +- ...5_sync_atomic.go => go1_18_sync_atomic.go} | 5 +- .../traefik/yaegi/stdlib/go1_18_testing.go | 126 ++ .../yaegi/stdlib/go1_18_testing_fstest.go | 22 + ...ing_iotest.go => go1_18_testing_iotest.go} | 7 +- ...sting_quick.go => go1_18_testing_quick.go} | 6 +- ...text_scanner.go => go1_18_text_scanner.go} | 5 +- ..._tabwriter.go => go1_18_text_tabwriter.go} | 5 +- ...xt_template.go => go1_18_text_template.go} | 6 +- ...parse.go => go1_18_text_template_parse.go} | 34 +- .../stdlib/{go1_16_time.go => go1_18_time.go} | 8 +- .../{go1_15_unicode.go => go1_18_unicode.go} | 11 +- ...icode_utf16.go => go1_18_unicode_utf16.go} | 5 +- ...unicode_utf8.go => go1_18_unicode_utf8.go} | 6 +- ...5_archive_tar.go => go1_19_archive_tar.go} | 5 +- ...5_archive_zip.go => go1_19_archive_zip.go} | 5 +- .../{go1_16_bufio.go => go1_19_bufio.go} | 5 +- .../{go1_16_bytes.go => go1_19_bytes.go} | 6 +- ...ress_bzip2.go => go1_19_compress_bzip2.go} | 5 +- ...ress_flate.go => go1_19_compress_flate.go} | 19 +- ...mpress_gzip.go => go1_19_compress_gzip.go} | 5 +- ...compress_lzw.go => go1_19_compress_lzw.go} | 9 +- ...mpress_zlib.go => go1_19_compress_zlib.go} | 10 +- ...ainer_heap.go => go1_19_container_heap.go} | 36 +- ...ainer_list.go => go1_19_container_list.go} | 5 +- ...ainer_ring.go => go1_19_container_ring.go} | 5 +- .../{go1_15_context.go => go1_19_context.go} | 24 +- .../{go1_15_crypto.go => go1_19_crypto.go} | 23 +- ..._16_crypto_aes.go => go1_19_crypto_aes.go} | 5 +- ...ypto_cipher.go => go1_19_crypto_cipher.go} | 41 +- ..._15_crypto_des.go => go1_19_crypto_des.go} | 5 +- ..._15_crypto_dsa.go => go1_19_crypto_dsa.go} | 5 +- ...crypto_ecdsa.go => go1_19_crypto_ecdsa.go} | 5 +- ...to_ed25519.go => go1_19_crypto_ed25519.go} | 5 +- ..._elliptic.go => go1_19_crypto_elliptic.go} | 14 +- ...5_crypto_hmac.go => go1_19_crypto_hmac.go} | 5 +- ..._16_crypto_md5.go => go1_19_crypto_md5.go} | 5 +- ...5_crypto_rand.go => go1_19_crypto_rand.go} | 5 +- ..._16_crypto_rc4.go => go1_19_crypto_rc4.go} | 5 +- ..._16_crypto_rsa.go => go1_19_crypto_rsa.go} | 5 +- ...6_crypto_sha1.go => go1_19_crypto_sha1.go} | 5 +- ...ypto_sha256.go => go1_19_crypto_sha256.go} | 5 +- ...ypto_sha512.go => go1_19_crypto_sha512.go} | 5 +- ...ypto_subtle.go => go1_19_crypto_subtle.go} | 5 +- ..._15_crypto_tls.go => go1_19_crypto_tls.go} | 10 +- ...6_crypto_x509.go => go1_19_crypto_x509.go} | 6 +- ...509_pkix.go => go1_19_crypto_x509_pkix.go} | 5 +- ...database_sql.go => go1_19_database_sql.go} | 23 +- ...river.go => go1_19_database_sql_driver.go} | 169 +- .../yaegi/stdlib/go1_19_debug_buildinfo.go | 22 + ...5_debug_dwarf.go => go1_19_debug_dwarf.go} | 21 +- ...o1_15_debug_elf.go => go1_19_debug_elf.go} | 170 +- ...5_debug_gosym.go => go1_19_debug_gosym.go} | 5 +- ...6_debug_macho.go => go1_19_debug_macho.go} | 12 +- ...{go1_15_debug_pe.go => go1_19_debug_pe.go} | 50 +- .../yaegi/stdlib/go1_19_debug_plan9obj.go | 33 + .../{go1_16_embed.go => go1_19_embed.go} | 5 +- ...{go1_16_encoding.go => go1_19_encoding.go} | 17 +- ..._ascii85.go => go1_19_encoding_ascii85.go} | 5 +- ...coding_asn1.go => go1_19_encoding_asn1.go} | 5 +- ...ng_base32.go => go1_19_encoding_base32.go} | 5 +- ...ng_base64.go => go1_19_encoding_base64.go} | 5 +- .../yaegi/stdlib/go1_19_encoding_binary.go | 105 ++ ...encoding_csv.go => go1_19_encoding_csv.go} | 5 +- ...encoding_gob.go => go1_19_encoding_gob.go} | 15 +- ...encoding_hex.go => go1_19_encoding_hex.go} | 5 +- ...coding_json.go => go1_19_encoding_json.go} | 16 +- ...encoding_pem.go => go1_19_encoding_pem.go} | 5 +- ...encoding_xml.go => go1_19_encoding_xml.go} | 15 +- .../{go1_16_errors.go => go1_19_errors.go} | 5 +- .../{go1_16_expvar.go => go1_19_expvar.go} | 13 +- .../stdlib/{go1_15_flag.go => go1_19_flag.go} | 37 +- .../stdlib/{go1_15_fmt.go => go1_19_fmt.go} | 73 +- .../{go1_16_go_ast.go => go1_19_go_ast.go} | 76 +- ...{go1_16_go_build.go => go1_19_go_build.go} | 5 +- .../stdlib/go1_19_go_build_constraint.go | 49 + ...5_go_constant.go => go1_19_go_constant.go} | 21 +- .../{go1_16_go_doc.go => go1_19_go_doc.go} | 5 +- ...o1_15_go_format.go => go1_19_go_format.go} | 5 +- ...5_go_importer.go => go1_19_go_importer.go} | 5 +- .../traefik/yaegi/stdlib/go1_19_go_parser.go | 32 + ..._15_go_printer.go => go1_19_go_printer.go} | 5 +- ..._15_go_scanner.go => go1_19_go_scanner.go} | 5 +- ...{go1_16_go_token.go => go1_19_go_token.go} | 6 +- ...{go1_16_go_types.go => go1_19_go_types.go} | 90 +- .../traefik/yaegi/stdlib/go1_19_hash.go | 111 ++ ...hash_adler32.go => go1_19_hash_adler32.go} | 5 +- ..._15_hash_crc32.go => go1_19_hash_crc32.go} | 5 +- ..._16_hash_crc64.go => go1_19_hash_crc64.go} | 5 +- ...{go1_15_hash_fnv.go => go1_19_hash_fnv.go} | 5 +- ...hash_maphash.go => go1_19_hash_maphash.go} | 7 +- .../stdlib/{go1_16_html.go => go1_19_html.go} | 5 +- ...ml_template.go => go1_19_html_template.go} | 5 +- .../{go1_15_image.go => go1_19_image.go} | 59 +- ...5_image_color.go => go1_19_image_color.go} | 17 +- ...lette.go => go1_19_image_color_palette.go} | 5 +- .../traefik/yaegi/stdlib/go1_19_image_draw.go | 109 ++ ...o1_16_image_gif.go => go1_19_image_gif.go} | 5 +- ..._15_image_jpeg.go => go1_19_image_jpeg.go} | 14 +- ...o1_16_image_png.go => go1_19_image_png.go} | 18 +- ...ixarray.go => go1_19_index_suffixarray.go} | 5 +- .../stdlib/{go1_16_io.go => go1_19_io.go} | 163 +- .../traefik/yaegi/stdlib/go1_19_io_fs.go | 246 +++ ...o1_15_io_ioutil.go => go1_19_io_ioutil.go} | 5 +- .../stdlib/{go1_16_log.go => go1_19_log.go} | 5 +- ..._15_log_syslog.go => go1_19_log_syslog.go} | 5 +- .../stdlib/{go1_15_math.go => go1_19_math.go} | 14 +- ...{go1_16_math_big.go => go1_19_math_big.go} | 5 +- ...o1_15_math_bits.go => go1_19_math_bits.go} | 5 +- ..._15_math_cmplx.go => go1_19_math_cmplx.go} | 5 +- ...o1_15_math_rand.go => go1_19_math_rand.go} | 27 +- .../stdlib/{go1_15_mime.go => go1_19_mime.go} | 5 +- ..._multipart.go => go1_19_mime_multipart.go} | 14 +- ...able.go => go1_19_mime_quotedprintable.go} | 5 +- .../stdlib/{go1_16_net.go => go1_19_net.go} | 103 +- ...{go1_15_net_http.go => go1_19_net_http.go} | 85 +- ...net_http_cgi.go => go1_19_net_http_cgi.go} | 5 +- ...kiejar.go => go1_19_net_http_cookiejar.go} | 13 +- ...t_http_fcgi.go => go1_19_net_http_fcgi.go} | 5 +- ...ttptest.go => go1_19_net_http_httptest.go} | 5 +- ...ptrace.go => go1_19_net_http_httptrace.go} | 5 +- ...ttputil.go => go1_19_net_http_httputil.go} | 18 +- ...http_pprof.go => go1_19_net_http_pprof.go} | 5 +- ...{go1_15_net_mail.go => go1_19_net_mail.go} | 5 +- .../traefik/yaegi/stdlib/go1_19_net_netip.go | 36 + .../{go1_15_net_rpc.go => go1_19_net_rpc.go} | 35 +- ...c_jsonrpc.go => go1_19_net_rpc_jsonrpc.go} | 5 +- ...{go1_15_net_smtp.go => go1_19_net_smtp.go} | 6 +- ...t_textproto.go => go1_19_net_textproto.go} | 5 +- .../{go1_15_net_url.go => go1_19_net_url.go} | 6 +- .../stdlib/{go1_16_os.go => go1_19_os.go} | 61 +- ...o1_16_os_signal.go => go1_19_os_signal.go} | 5 +- .../{go1_15_os_user.go => go1_19_os_user.go} | 5 +- .../stdlib/{go1_15_path.go => go1_19_path.go} | 5 +- ...th_filepath.go => go1_19_path_filepath.go} | 5 +- .../{go1_15_reflect.go => go1_19_reflect.go} | 120 +- .../{go1_15_regexp.go => go1_19_regexp.go} | 5 +- ...gexp_syntax.go => go1_19_regexp_syntax.go} | 6 +- .../{go1_15_runtime.go => go1_19_runtime.go} | 14 +- ...ntime_debug.go => go1_19_runtime_debug.go} | 14 +- .../yaegi/stdlib/go1_19_runtime_metrics.go | 30 + ...ntime_pprof.go => go1_19_runtime_pprof.go} | 5 +- ...ntime_trace.go => go1_19_runtime_trace.go} | 5 +- .../stdlib/{go1_15_sort.go => go1_19_sort.go} | 25 +- .../{go1_16_strconv.go => go1_19_strconv.go} | 6 +- .../{go1_15_strings.go => go1_19_strings.go} | 7 +- .../stdlib/{go1_15_sync.go => go1_19_sync.go} | 14 +- ...6_sync_atomic.go => go1_19_sync_atomic.go} | 13 +- .../traefik/yaegi/stdlib/go1_19_testing.go | 126 ++ .../yaegi/stdlib/go1_19_testing_fstest.go | 22 + ...ing_iotest.go => go1_19_testing_iotest.go} | 5 +- ...sting_quick.go => go1_19_testing_quick.go} | 6 +- ...text_scanner.go => go1_19_text_scanner.go} | 5 +- ..._tabwriter.go => go1_19_text_tabwriter.go} | 5 +- ...xt_template.go => go1_19_text_template.go} | 5 +- ...parse.go => go1_19_text_template_parse.go} | 30 +- .../stdlib/{go1_15_time.go => go1_19_time.go} | 8 +- .../{go1_16_unicode.go => go1_19_unicode.go} | 5 +- ...icode_utf16.go => go1_19_unicode_utf16.go} | 5 +- ...unicode_utf8.go => go1_19_unicode_utf8.go} | 6 +- .../traefik/yaegi/stdlib/maptypes.go | 58 + .../github.com/traefik/yaegi/stdlib/stdlib.go | 26 +- .../traefik/yaegi/stdlib/stdlib_go1.16.go | 5 - .../traefik/yaegi/stdlib/wrapper-composed.go | 88 + vendor/modules.txt | 3 +- 332 files changed, 10360 insertions(+), 3739 deletions(-) create mode 100644 vendor/github.com/traefik/yaegi/internal/unsafe2/unsafe.go create mode 100644 vendor/github.com/traefik/yaegi/interp/debugger.go create mode 100644 vendor/github.com/traefik/yaegi/interp/generic.go create mode 100644 vendor/github.com/traefik/yaegi/interp/program.go create mode 100644 vendor/github.com/traefik/yaegi/interp/realfs.go create mode 100644 vendor/github.com/traefik/yaegi/interp/typestring.go create mode 100644 vendor/github.com/traefik/yaegi/interp/use.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_plan9obj.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_go_parser.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_hash.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_image_draw.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_os_signal.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_15_testing.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_plan9obj.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_binary.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_go_parser.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_hash.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_image_draw.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_16_testing.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_archive_tar.go => go1_18_archive_tar.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_archive_zip.go => go1_18_archive_zip.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_bufio.go => go1_18_bufio.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_bytes.go => go1_18_bytes.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_compress_bzip2.go => go1_18_compress_bzip2.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_compress_flate.go => go1_18_compress_flate.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_compress_gzip.go => go1_18_compress_gzip.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_compress_lzw.go => go1_18_compress_lzw.go} (60%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_compress_zlib.go => go1_18_compress_zlib.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_container_heap.go => go1_18_container_heap.go} (53%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_container_list.go => go1_18_container_list.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_container_ring.go => go1_18_container_ring.go} (72%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_context.go => go1_18_context.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto.go => go1_18_crypto.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_aes.go => go1_18_crypto_aes.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_cipher.go => go1_18_crypto_cipher.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_des.go => go1_18_crypto_des.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_dsa.go => go1_18_crypto_dsa.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_ecdsa.go => go1_18_crypto_ecdsa.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_ed25519.go => go1_18_crypto_ed25519.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_elliptic.go => go1_18_crypto_elliptic.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_hmac.go => go1_18_crypto_hmac.go} (70%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_md5.go => go1_18_crypto_md5.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_rand.go => go1_18_crypto_rand.go} (76%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_rc4.go => go1_18_crypto_rc4.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_rsa.go => go1_18_crypto_rsa.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_sha1.go => go1_18_crypto_sha1.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_sha256.go => go1_18_crypto_sha256.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_sha512.go => go1_18_crypto_sha512.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_subtle.go => go1_18_crypto_subtle.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_tls.go => go1_18_crypto_tls.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_x509.go => go1_18_crypto_x509.go} (98%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_x509_pkix.go => go1_18_crypto_x509_pkix.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_database_sql.go => go1_18_database_sql.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_database_sql_driver.go => go1_18_database_sql_driver.go} (87%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_buildinfo.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_debug_dwarf.go => go1_18_debug_dwarf.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_debug_elf.go => go1_18_debug_elf.go} (99%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_debug_gosym.go => go1_18_debug_gosym.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_debug_macho.go => go1_18_debug_macho.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_debug_pe.go => go1_18_debug_pe.go} (98%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_plan9obj.go create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_embed.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding.go => go1_18_encoding.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_ascii85.go => go1_18_encoding_ascii85.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_asn1.go => go1_18_encoding_asn1.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_base32.go => go1_18_encoding_base32.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_base64.go => go1_18_encoding_base64.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_binary.go => go1_18_encoding_binary.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_csv.go => go1_18_encoding_csv.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_gob.go => go1_18_encoding_gob.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_hex.go => go1_18_encoding_hex.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_json.go => go1_18_encoding_json.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_pem.go => go1_18_encoding_pem.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_xml.go => go1_18_encoding_xml.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_errors.go => go1_18_errors.go} (76%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_expvar.go => go1_18_expvar.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_flag.go => go1_18_flag.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_fmt.go => go1_18_fmt.go} (72%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_ast.go => go1_18_go_ast.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_build.go => go1_18_go_build.go} (90%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build_constraint.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_constant.go => go1_18_go_constant.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_doc.go => go1_18_go_doc.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_format.go => go1_18_go_format.go} (70%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_importer.go => go1_18_go_importer.go} (78%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_go_parser.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_printer.go => go1_18_go_printer.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_scanner.go => go1_18_go_scanner.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_token.go => go1_18_go_token.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_types.go => go1_18_go_types.go} (83%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_hash.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_hash_adler32.go => go1_18_hash_adler32.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_hash_crc32.go => go1_18_hash_crc32.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_hash_crc64.go => go1_18_hash_crc64.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_hash_fnv.go => go1_18_hash_fnv.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_hash_maphash.go => go1_18_hash_maphash.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_html.go => go1_18_html.go} (73%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_html_template.go => go1_18_html_template.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image.go => go1_18_image.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image_color.go => go1_18_image_color.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image_color_palette.go => go1_18_image_color_palette.go} (71%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_image_draw.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image_gif.go => go1_18_image_gif.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image_jpeg.go => go1_18_image_jpeg.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image_png.go => go1_18_image_png.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_index_suffixarray.go => go1_18_index_suffixarray.go} (72%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_io.go => go1_18_io.go} (72%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_io_fs.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_io_ioutil.go => go1_18_io_ioutil.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_log.go => go1_18_log.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_log_syslog.go => go1_18_log_syslog.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_math.go => go1_18_math.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_math_big.go => go1_18_math_big.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_math_bits.go => go1_18_math_bits.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_math_cmplx.go => go1_18_math_cmplx.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_math_rand.go => go1_18_math_rand.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_mime.go => go1_18_mime.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_mime_multipart.go => go1_18_mime_multipart.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_mime_quotedprintable.go => go1_18_mime_quotedprintable.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net.go => go1_18_net.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http.go => go1_18_net_http.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_cgi.go => go1_18_net_http_cgi.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_cookiejar.go => go1_18_net_http_cookiejar.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_fcgi.go => go1_18_net_http_fcgi.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_httptest.go => go1_18_net_http_httptest.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_httptrace.go => go1_18_net_http_httptrace.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_httputil.go => go1_18_net_http_httputil.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_pprof.go => go1_18_net_http_pprof.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_mail.go => go1_18_net_mail.go} (87%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_net_netip.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_rpc.go => go1_18_net_rpc.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_rpc_jsonrpc.go => go1_18_net_rpc_jsonrpc.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_smtp.go => go1_18_net_smtp.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_textproto.go => go1_18_net_textproto.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_url.go => go1_18_net_url.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_os.go => go1_18_os.go} (80%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_os_signal.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_os_user.go => go1_18_os_user.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_path.go => go1_18_path.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_path_filepath.go => go1_18_path_filepath.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_reflect.go => go1_18_reflect.go} (70%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_regexp.go => go1_18_regexp.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_regexp_syntax.go => go1_18_regexp_syntax.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_runtime.go => go1_18_runtime.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_runtime_debug.go => go1_18_runtime_debug.go} (67%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_metrics.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_runtime_pprof.go => go1_18_runtime_pprof.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_runtime_trace.go => go1_18_runtime_trace.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_sort.go => go1_18_sort.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_strconv.go => go1_18_strconv.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_strings.go => go1_18_strings.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_sync.go => go1_18_sync.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_sync_atomic.go => go1_18_sync_atomic.go} (95%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_testing.go create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_fstest.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_testing_iotest.go => go1_18_testing_iotest.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_testing_quick.go => go1_18_testing_quick.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_text_scanner.go => go1_18_text_scanner.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_text_tabwriter.go => go1_18_text_tabwriter.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_text_template.go => go1_18_text_template.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_text_template_parse.go => go1_18_text_template_parse.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_time.go => go1_18_time.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_unicode.go => go1_18_unicode.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_unicode_utf16.go => go1_18_unicode_utf16.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_unicode_utf8.go => go1_18_unicode_utf8.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_archive_tar.go => go1_19_archive_tar.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_archive_zip.go => go1_19_archive_zip.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_bufio.go => go1_19_bufio.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_bytes.go => go1_19_bytes.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_compress_bzip2.go => go1_19_compress_bzip2.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_compress_flate.go => go1_19_compress_flate.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_compress_gzip.go => go1_19_compress_gzip.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_compress_lzw.go => go1_19_compress_lzw.go} (61%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_compress_zlib.go => go1_19_compress_zlib.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_container_heap.go => go1_19_container_heap.go} (53%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_container_list.go => go1_19_container_list.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_container_ring.go => go1_19_container_ring.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_context.go => go1_19_context.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto.go => go1_19_crypto.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_aes.go => go1_19_crypto_aes.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_cipher.go => go1_19_crypto_cipher.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_des.go => go1_19_crypto_des.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_dsa.go => go1_19_crypto_dsa.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_ecdsa.go => go1_19_crypto_ecdsa.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_ed25519.go => go1_19_crypto_ed25519.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_elliptic.go => go1_19_crypto_elliptic.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_hmac.go => go1_19_crypto_hmac.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_md5.go => go1_19_crypto_md5.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_rand.go => go1_19_crypto_rand.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_rc4.go => go1_19_crypto_rc4.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_rsa.go => go1_19_crypto_rsa.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_sha1.go => go1_19_crypto_sha1.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_sha256.go => go1_19_crypto_sha256.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_sha512.go => go1_19_crypto_sha512.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_subtle.go => go1_19_crypto_subtle.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_tls.go => go1_19_crypto_tls.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_crypto_x509.go => go1_19_crypto_x509.go} (98%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_crypto_x509_pkix.go => go1_19_crypto_x509_pkix.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_database_sql.go => go1_19_database_sql.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_database_sql_driver.go => go1_19_database_sql_driver.go} (87%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_buildinfo.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_debug_dwarf.go => go1_19_debug_dwarf.go} (98%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_debug_elf.go => go1_19_debug_elf.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_debug_gosym.go => go1_19_debug_gosym.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_debug_macho.go => go1_19_debug_macho.go} (98%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_debug_pe.go => go1_19_debug_pe.go} (76%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_plan9obj.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_embed.go => go1_19_embed.go} (68%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding.go => go1_19_encoding.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_ascii85.go => go1_19_encoding_ascii85.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_asn1.go => go1_19_encoding_asn1.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_base32.go => go1_19_encoding_base32.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_base64.go => go1_19_encoding_base64.go} (90%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_binary.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_csv.go => go1_19_encoding_csv.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_gob.go => go1_19_encoding_gob.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_hex.go => go1_19_encoding_hex.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_json.go => go1_19_encoding_json.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_encoding_pem.go => go1_19_encoding_pem.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_encoding_xml.go => go1_19_encoding_xml.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_errors.go => go1_19_errors.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_expvar.go => go1_19_expvar.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_flag.go => go1_19_flag.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_fmt.go => go1_19_fmt.go} (69%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_ast.go => go1_19_go_ast.go} (85%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_build.go => go1_19_go_build.go} (92%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build_constraint.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_constant.go => go1_19_go_constant.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_doc.go => go1_19_go_doc.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_format.go => go1_19_go_format.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_importer.go => go1_19_go_importer.go} (81%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_go_parser.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_printer.go => go1_19_go_printer.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_go_scanner.go => go1_19_go_scanner.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_token.go => go1_19_go_token.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_go_types.go => go1_19_go_types.go} (83%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_hash.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_hash_adler32.go => go1_19_hash_adler32.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_hash_crc32.go => go1_19_hash_crc32.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_hash_crc64.go => go1_19_hash_crc64.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_hash_fnv.go => go1_19_hash_fnv.go} (83%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_hash_maphash.go => go1_19_hash_maphash.go} (65%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_html.go => go1_19_html.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_html_template.go => go1_19_html_template.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image.go => go1_19_image.go} (74%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image_color.go => go1_19_image_color.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image_color_palette.go => go1_19_image_color_palette.go} (75%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_image_draw.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image_gif.go => go1_19_image_gif.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_image_jpeg.go => go1_19_image_jpeg.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_image_png.go => go1_19_image_png.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_index_suffixarray.go => go1_19_index_suffixarray.go} (75%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_io.go => go1_19_io.go} (77%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_io_fs.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_io_ioutil.go => go1_19_io_ioutil.go} (86%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_log.go => go1_19_log.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_log_syslog.go => go1_19_log_syslog.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_math.go => go1_19_math.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_math_big.go => go1_19_math_big.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_math_bits.go => go1_19_math_bits.go} (97%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_math_cmplx.go => go1_19_math_cmplx.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_math_rand.go => go1_19_math_rand.go} (79%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_mime.go => go1_19_mime.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_mime_multipart.go => go1_19_mime_multipart.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_mime_quotedprintable.go => go1_19_mime_quotedprintable.go} (80%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net.go => go1_19_net.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http.go => go1_19_net_http.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_cgi.go => go1_19_net_http_cgi.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_cookiejar.go => go1_19_net_http_cookiejar.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_fcgi.go => go1_19_net_http_fcgi.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_httptest.go => go1_19_net_http_httptest.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_http_httptrace.go => go1_19_net_http_httptrace.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_httputil.go => go1_19_net_http_httputil.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_http_pprof.go => go1_19_net_http_pprof.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_mail.go => go1_19_net_mail.go} (89%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_net_netip.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_rpc.go => go1_19_net_rpc.go} (77%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_rpc_jsonrpc.go => go1_19_net_rpc_jsonrpc.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_smtp.go => go1_19_net_smtp.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_net_textproto.go => go1_19_net_textproto.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_net_url.go => go1_19_net_url.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_os.go => go1_19_os.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_os_signal.go => go1_19_os_signal.go} (84%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_os_user.go => go1_19_os_user.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_path.go => go1_19_path.go} (87%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_path_filepath.go => go1_19_path_filepath.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_reflect.go => go1_19_reflect.go} (69%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_regexp.go => go1_19_regexp.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_regexp_syntax.go => go1_19_regexp_syntax.go} (96%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_runtime.go => go1_19_runtime.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_runtime_debug.go => go1_19_runtime_debug.go} (65%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_metrics.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_runtime_pprof.go => go1_19_runtime_pprof.go} (91%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_runtime_trace.go => go1_19_runtime_trace.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_sort.go => go1_19_sort.go} (78%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_strconv.go => go1_19_strconv.go} (94%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_strings.go => go1_19_strings.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_sync.go => go1_19_sync.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_sync_atomic.go => go1_19_sync_atomic.go} (81%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_testing.go create mode 100644 vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_fstest.go rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_testing_iotest.go => go1_19_testing_iotest.go} (88%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_testing_quick.go => go1_19_testing_quick.go} (90%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_text_scanner.go => go1_19_text_scanner.go} (95%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_text_tabwriter.go => go1_19_text_tabwriter.go} (89%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_text_template.go => go1_19_text_template.go} (92%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_text_template_parse.go => go1_19_text_template_parse.go} (81%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_time.go => go1_19_time.go} (93%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_16_unicode.go => go1_19_unicode.go} (99%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_unicode_utf16.go => go1_19_unicode_utf16.go} (82%) rename vendor/github.com/traefik/yaegi/stdlib/{go1_15_unicode_utf8.go => go1_19_unicode_utf8.go} (90%) create mode 100644 vendor/github.com/traefik/yaegi/stdlib/maptypes.go delete mode 100644 vendor/github.com/traefik/yaegi/stdlib/stdlib_go1.16.go create mode 100644 vendor/github.com/traefik/yaegi/stdlib/wrapper-composed.go diff --git a/go.mod b/go.mod index 0925968..7bb70dc 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require ( github.com/jackc/pgconn v1.8.1 github.com/jackc/pgx/v4 v4.11.0 github.com/stretchr/testify v1.7.0 - github.com/traefik/yaegi v0.9.15 + github.com/traefik/yaegi v0.14.2 ) diff --git a/go.sum b/go.sum index 49dba86..9b1626f 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/traefik/yaegi v0.9.10/go.mod h1:FAYnRlZyuVlEkvnkHq3bvJ1lW5be6XuwgLdkYgYG6Lk= -github.com/traefik/yaegi v0.9.15 h1:8AboQQiXe7iSVWnrzxFmUUx9FZj1x+ekXPt/UVLrqS4= -github.com/traefik/yaegi v0.9.15/go.mod h1:FAYnRlZyuVlEkvnkHq3bvJ1lW5be6XuwgLdkYgYG6Lk= +github.com/traefik/yaegi v0.14.2 h1:9t9xepIfar6BrYdwJHGc+XRKo6qFoJCl6Z46N3hUtUw= +github.com/traefik/yaegi v0.14.2/go.mod h1:AVRxhaI2G+nUsaM1zyktzwXn69G3t/AuTDrCiTds9p0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= diff --git a/vendor/github.com/traefik/yaegi/internal/unsafe2/unsafe.go b/vendor/github.com/traefik/yaegi/internal/unsafe2/unsafe.go new file mode 100644 index 0000000..47f96ad --- /dev/null +++ b/vendor/github.com/traefik/yaegi/internal/unsafe2/unsafe.go @@ -0,0 +1,61 @@ +package unsafe2 + +import ( + "reflect" + "unsafe" +) + +type dummy struct{} + +// DummyType represents a stand-in for a recursive type. +var DummyType = reflect.TypeOf(dummy{}) + +// the following type sizes must match their original definition in Go src/reflect/type.go. + +type rtype struct { + _ uintptr + _ uintptr + _ uint32 + _ uint32 + _ uintptr + _ uintptr + _ uint32 + _ uint32 +} + +type emptyInterface struct { + typ *rtype + _ unsafe.Pointer +} + +type structField struct { + _ uintptr + typ *rtype + _ uintptr +} + +type structType struct { + rtype + _ uintptr + fields []structField +} + +// SetFieldType sets the type of the struct field at the given index, to the given type. +// +// The struct type must have been created at runtime. This is very unsafe. +func SetFieldType(s reflect.Type, idx int, t reflect.Type) { + if s.Kind() != reflect.Struct || idx >= s.NumField() { + return + } + + rtyp := unpackType(s) + styp := (*structType)(unsafe.Pointer(rtyp)) + f := styp.fields[idx] + f.typ = unpackType(t) + styp.fields[idx] = f +} + +func unpackType(t reflect.Type) *rtype { + v := reflect.New(t).Elem().Interface() + return (*emptyInterface)(unsafe.Pointer(&v)).typ +} diff --git a/vendor/github.com/traefik/yaegi/interp/ast.go b/vendor/github.com/traefik/yaegi/interp/ast.go index 502a046..1e71ac4 100644 --- a/vendor/github.com/traefik/yaegi/interp/ast.go +++ b/vendor/github.com/traefik/yaegi/interp/ast.go @@ -1,7 +1,6 @@ package interp import ( - "errors" "fmt" "go/ast" "go/constant" @@ -73,6 +72,7 @@ const ( importSpec incDecStmt indexExpr + indexListExpr interfaceType keyValueExpr labeledStmt @@ -93,7 +93,8 @@ const ( switchIfStmt typeAssertExpr typeDecl - typeSpec + typeSpec // type A int + typeSpecAssign // type A = int typeSwitch unaryExpr valueSpec @@ -155,6 +156,7 @@ var kinds = [...]string{ importSpec: "importSpec", incDecStmt: "incDecStmt", indexExpr: "indexExpr", + indexListExpr: "indexListExpr", interfaceType: "interfaceType", keyValueExpr: "keyValueExpr", labeledStmt: "labeledStmt", @@ -176,6 +178,7 @@ var kinds = [...]string{ typeAssertExpr: "typeAssertExpr", typeDecl: "typeDecl", typeSpec: "typeSpec", + typeSpecAssign: "typeSpecAssign", typeSwitch: "typeSwitch", unaryExpr: "unaryExpr", valueSpec: "valueSpec", @@ -281,6 +284,7 @@ var actions = [...]string{ aDec: "--", aEqual: "==", aGreater: ">", + aGreaterEqual: ">=", aGetFunc: "getFunc", aGetIndex: "getIndex", aGetMethod: "getMethod", @@ -289,6 +293,7 @@ var actions = [...]string{ aLand: "&&", aLor: "||", aLower: "<", + aLowerEqual: "<=", aMethod: "Method", aMul: "*", aMulAssign: "*=", @@ -357,24 +362,17 @@ func ignoreError(err error, src string) bool { } func wrapInMain(src string) string { - return fmt.Sprintf("package main; func main() {%s}", src) + return fmt.Sprintf("package main; func main() {%s\n}", src) } -// Note: no type analysis is performed at this stage, it is done in pre-order -// processing of CFG, in order to accommodate forward type declarations. - -// ast parses src string containing Go code and generates the corresponding AST. -// The package name and the AST root node are returned. -// The given name is used to set the filename of the relevant source file in the -// interpreter's FileSet. -func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error) { - var inFunc bool +func (interp *Interpreter) parse(src, name string, inc bool) (node ast.Node, err error) { mode := parser.DeclarationErrors // Allow incremental parsing of declarations or statements, by inserting // them in a pseudo file package or function. Those statements or // declarations will be always evaluated in the global scope. var tok token.Token + var inFunc bool if inc { tok = interp.firstToken(src) switch tok { @@ -391,18 +389,18 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error } if ok, err := interp.buildOk(&interp.context, name, src); !ok || err != nil { - return "", nil, err // skip source not matching build constraints + return nil, err // skip source not matching build constraints } f, err := parser.ParseFile(interp.fset, name, src, mode) if err != nil { // only retry if we're on an expression/statement about a func if !inc || tok != token.FUNC { - return "", nil, err + return nil, err } // do not bother retrying if we know it's an error we're going to ignore later on. if ignoreError(err, src) { - return "", nil, err + return nil, err } // do not lose initial error, in case retrying fails. initialError := err @@ -410,16 +408,32 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error src := wrapInMain(strings.TrimPrefix(src, "package main;")) f, err = parser.ParseFile(interp.fset, name, src, mode) if err != nil { - return "", nil, initialError + return nil, initialError } } + if inFunc { + // return the body of the wrapper main function + return f.Decls[0].(*ast.FuncDecl).Body, nil + } + setYaegiTags(&interp.context, f.Comments) + return f, nil +} + +// Note: no type analysis is performed at this stage, it is done in pre-order +// processing of CFG, in order to accommodate forward type declarations. +// ast parses src string containing Go code and generates the corresponding AST. +// The package name and the AST root node are returned. +// The given name is used to set the filename of the relevant source file in the +// interpreter's FileSet. +func (interp *Interpreter) ast(f ast.Node) (string, *node, error) { + var err error var root *node var anc astNode var st nodestack - var pkgName string + pkgName := "main" addChild := func(root **node, anc astNode, pos token.Pos, kind nkind, act action) *node { var i interface{} @@ -627,7 +641,7 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error } st.push(addChild(&root, anc, pos, kind, aNop), nod) - case *ast.CommentGroup: + case *ast.CommentGroup, *ast.EmptyStmt: return false case *ast.CompositeLit: @@ -680,8 +694,9 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error case *ast.FuncDecl: n := addChild(&root, anc, pos, funcDecl, aNop) + n.val = n if a.Recv == nil { - // function is not a method, create an empty receiver list + // Function is not a method, create an empty receiver list. addChild(&root, astNode{n, nod}, pos, fieldList, aNop) } st.push(n, nod) @@ -693,7 +708,13 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error st.push(n, nod) case *ast.FuncType: - st.push(addChild(&root, anc, pos, funcType, aNop), nod) + n := addChild(&root, anc, pos, funcType, aNop) + n.val = n + if a.TypeParams == nil { + // Function has no type parameters, create an empty fied list. + addChild(&root, astNode{n, nod}, pos, fieldList, aNop) + } + st.push(n, nod) case *ast.GenDecl: var kind nkind @@ -716,7 +737,7 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error n := addChild(&root, anc, pos, identExpr, aNop) n.ident = a.Name st.push(n, nod) - if n.anc.kind == defineStmt && n.anc.nright == 0 { + if n.anc.kind == defineStmt && n.anc.anc.kind == constDecl && n.anc.nright == 0 { // Implicit assign expression (in a ConstDecl block). // Clone assign source and type from previous a := n.anc @@ -763,6 +784,9 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error case *ast.IndexExpr: st.push(addChild(&root, anc, pos, indexExpr, aGetIndex), nod) + case *ast.IndexListExpr: + st.push(addChild(&root, anc, pos, indexListExpr, aNop), nod) + case *ast.InterfaceType: st.push(addChild(&root, anc, pos, interfaceType, aNop), nod) @@ -825,6 +849,10 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error st.push(addChild(&root, anc, pos, typeAssertExpr, aTypeAssert), nod) case *ast.TypeSpec: + if a.Assign.IsValid() { + st.push(addChild(&root, anc, pos, typeSpecAssign, aNop), nod) + break + } st.push(addChild(&root, anc, pos, typeSpec, aNop), nod) case *ast.TypeSwitchStmt: @@ -858,7 +886,8 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error case *ast.ValueSpec: kind := valueSpec act := aNop - if a.Values != nil { + switch { + case a.Values != nil: if len(a.Names) > 1 && len(a.Values) == 1 { if anc.node.kind == constDecl || anc.node.kind == varDecl { kind = defineXStmt @@ -874,7 +903,9 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error } act = aAssign } - } else if anc.node.kind == constDecl { + case anc.node.kind == constDecl: + kind, act = defineStmt, aAssign + case anc.node.kind == varDecl && anc.node.anc.kind != fileStmt: kind, act = defineStmt, aAssign } n := addChild(&root, anc, pos, kind, act) @@ -888,15 +919,8 @@ func (interp *Interpreter) ast(src, name string, inc bool) (string, *node, error } return true }) - if inFunc { - // Incremental parsing: statements were inserted in a pseudo function. - // Set root to function body so its statements are evaluated in global scope. - root = root.child[1].child[3] - root.anc = nil - } - if pkgName == "" { - return "", root, errors.New("no package name found") - } + + interp.roots = append(interp.roots, root) return pkgName, root, err } diff --git a/vendor/github.com/traefik/yaegi/interp/build.go b/vendor/github.com/traefik/yaegi/interp/build.go index 0a09683..1e641b7 100644 --- a/vendor/github.com/traefik/yaegi/interp/build.go +++ b/vendor/github.com/traefik/yaegi/interp/build.go @@ -178,6 +178,7 @@ var knownArch = map[string]bool{ "amd64": true, "arm": true, "arm64": true, + "loong64": true, "mips": true, "mips64": true, "mips64le": true, diff --git a/vendor/github.com/traefik/yaegi/interp/cfg.go b/vendor/github.com/traefik/yaegi/interp/cfg.go index 33db22d..73721ef 100644 --- a/vendor/github.com/traefik/yaegi/interp/cfg.go +++ b/vendor/github.com/traefik/yaegi/interp/cfg.go @@ -7,7 +7,6 @@ import ( "math" "path/filepath" "reflect" - "regexp" "strings" "unicode" ) @@ -44,17 +43,17 @@ var constBltn = map[string]func(*node){ bltnReal: realConst, } -var identifier = regexp.MustCompile(`([\pL_][\pL_\d]*)$`) - const nilIdent = "nil" // cfg generates a control flow graph (CFG) from AST (wiring successors in AST) // and pre-compute frame sizes and indexes for all un-named (temporary) and named // variables. A list of nodes of init functions is returned. // Following this pass, the CFG is ready to run. -func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { - sc := interp.initScopePkg(importPath) - check := typecheck{} +func (interp *Interpreter) cfg(root *node, sc *scope, importPath, pkgName string) ([]*node, error) { + if sc == nil { + sc = interp.initScopePkg(importPath, pkgName) + } + check := typecheck{scope: sc} var initNodes []*node var err error @@ -65,6 +64,9 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if err != nil { return false } + if n.scope == nil { + n.scope = sc + } switch n.kind { case binaryExpr, unaryExpr, parenExpr: if isBoolAction(n) { @@ -143,27 +145,31 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } switch o.typ.cat { - case valueT: + case valueT, aliasT: typ := o.typ.rtype + if o.typ.cat == aliasT { + typ = o.typ.val.TypeOf() + } switch typ.Kind() { case reflect.Map: n.anc.gen = rangeMap - ityp := &itype{cat: valueT, rtype: reflect.TypeOf((*reflect.MapIter)(nil))} + ityp := valueTOf(reflect.TypeOf((*reflect.MapIter)(nil))) sc.add(ityp) - ktyp = &itype{cat: valueT, rtype: typ.Key()} - vtyp = &itype{cat: valueT, rtype: typ.Elem()} + ktyp = valueTOf(typ.Key()) + vtyp = valueTOf(typ.Elem()) case reflect.String: sc.add(sc.getType("int")) // Add a dummy type to store array shallow copy for range + sc.add(sc.getType("int")) // Add a dummy type to store index for range ktyp = sc.getType("int") vtyp = sc.getType("rune") case reflect.Array, reflect.Slice: sc.add(sc.getType("int")) // Add a dummy type to store array shallow copy for range ktyp = sc.getType("int") - vtyp = &itype{cat: valueT, rtype: typ.Elem()} + vtyp = valueTOf(typ.Elem()) } case mapT: n.anc.gen = rangeMap - ityp := &itype{cat: valueT, rtype: reflect.TypeOf((*reflect.MapIter)(nil))} + ityp := valueTOf(reflect.TypeOf((*reflect.MapIter)(nil))) sc.add(ityp) ktyp = o.typ.key vtyp = o.typ.val @@ -171,15 +177,16 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { ktyp = sc.getType("int") vtyp = o.typ.val if vtyp.cat == valueT { - vtyp = &itype{cat: valueT, rtype: vtyp.rtype.Elem()} + vtyp = valueTOf(vtyp.rtype.Elem()) } else { vtyp = vtyp.val } case stringT: sc.add(sc.getType("int")) // Add a dummy type to store array shallow copy for range + sc.add(sc.getType("int")) // Add a dummy type to store index for range ktyp = sc.getType("int") vtyp = sc.getType("rune") - case arrayT, variadicT: + case arrayT, sliceT, variadicT: sc.add(sc.getType("int")) // Add a dummy type to store array shallow copy for range ktyp = sc.getType("int") vtyp = o.typ.val @@ -198,38 +205,50 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } } } + n.findex = -1 n.val = nil sc = sc.pushBloc() - - case breakStmt, continueStmt, gotoStmt: - if len(n.child) > 0 { - // Handle labeled statements. - label := n.child[0].ident - if sym, _, ok := sc.lookup(label); ok { - if sym.kind != labelSym { - err = n.child[0].cfgErrorf("label %s not defined", label) - break - } - sym.from = append(sym.from, n) - n.sym = sym - } else { - n.sym = &symbol{kind: labelSym, from: []*node{n}, index: -1} - sc.sym[label] = n.sym + // Pre-define symbols for labels defined in this block, so we are sure that + // they are already defined when met. + // TODO(marc): labels must be stored outside of symbols to avoid collisions. + for _, c := range n.child { + if c.kind != labeledStmt { + continue + } + label := c.child[0].ident + sym := &symbol{kind: labelSym, node: c, index: -1} + sc.sym[label] = sym + c.sym = sym + } + // If block is the body of a function, get declared variables in current scope. + // This is done in order to add the func signature symbols into sc.sym, + // as we will need them in post-processing. + if n.anc != nil && n.anc.kind == funcDecl { + for k, v := range sc.anc.sym { + sc.sym[k] = v } } - case labeledStmt: + case breakStmt, continueStmt, gotoStmt: + if len(n.child) == 0 { + break + } + // Handle labeled statements. label := n.child[0].ident - // TODO(marc): labels must be stored outside of symbols to avoid collisions - // Used labels are searched in current and sub scopes, not upper ones. - if sym, ok := sc.lookdown(label); ok { - sym.node = n + if sym, _, ok := sc.lookup(label); ok { + if sym.kind != labelSym { + err = n.child[0].cfgErrorf("label %s not defined", label) + break + } n.sym = sym } else { - n.sym = &symbol{kind: labelSym, node: n, index: -1} + n.sym = &symbol{kind: labelSym, index: -1} + sc.sym[label] = n.sym + } + if n.kind == gotoStmt { + n.sym.from = append(n.sym.from, n) // To allow forward goto statements. } - sc.sym[label] = n.sym case caseClause: sc = sc.pushBloc() @@ -285,19 +304,19 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case compositeLitExpr: if len(n.child) > 0 && n.child[0].isType(sc) { - // Get type from 1st child + // Get type from 1st child. if n.typ, err = nodeType(interp, sc, n.child[0]); err != nil { return false } - // Indicate that the first child is the type + // Indicate that the first child is the type. n.nleft = 1 } else { - // Get type from ancestor (implicit type) + // Get type from ancestor (implicit type). if n.anc.kind == keyValueExpr && n == n.anc.child[0] { n.typ = n.anc.typ.key } else if atyp := n.anc.typ; atyp != nil { - if atyp.cat == valueT { - n.typ = &itype{cat: valueT, rtype: atyp.rtype.Elem()} + if atyp.cat == valueT && hasElem(atyp.rtype) { + n.typ = valueTOf(atyp.rtype.Elem()) } else { n.typ = atyp.val } @@ -315,6 +334,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } // Propagate type to children, to handle implicit types for _, c := range child { + if isBlank(c) { + err = n.cfgErrorf("cannot use _ as value") + return false + } switch c.kind { case binaryExpr, unaryExpr, compositeLitExpr: // Do not attempt to propagate composite type to operator expressions, @@ -345,16 +368,55 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { fallthrough case funcDecl: + // Do not allow function declarations without body. + if len(n.child) < 4 { + err = n.cfgErrorf("function declaration without body is unsupported (linkname or assembly can not be interpreted).") + return false + } n.val = n + + // Skip substree in case of a generic function. + if len(n.child[2].child[0].child) > 0 { + return false + } + + // Skip subtree if the function is a method with a generic receiver. + if len(n.child[0].child) > 0 { + recvTypeNode := n.child[0].child[0].lastChild() + typ, err := nodeType(interp, sc, recvTypeNode) + if err != nil { + return false + } + if typ.cat == genericT || (typ.val != nil && typ.val.cat == genericT) { + return false + } + if typ.cat == ptrT { + rc0 := recvTypeNode.child[0] + rt0, err := nodeType(interp, sc, rc0) + if err != nil { + return false + } + if rc0.kind == indexExpr && rt0.cat == structT { + return false + } + } + } + // Compute function type before entering local scope to avoid // possible collisions with function argument names. n.child[2].typ, err = nodeType(interp, sc, n.child[2]) - // Add a frame indirection level as we enter in a func + if err != nil { + return false + } + n.typ = n.child[2].typ + + // Add a frame indirection level as we enter in a func. sc = sc.pushFunc() sc.def = n - if len(n.child[2].child) == 2 { - // Allocate frame space for return values, define output symbols - for _, c := range n.child[2].child[1].child { + + // Allocate frame space for return values, define output symbols. + if len(n.child[2].child) == 3 { + for _, c := range n.child[2].child[2].child { var typ *itype if typ, err = nodeType(interp, sc, c.lastChild()); err != nil { return false @@ -368,8 +430,9 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } } } + + // Define receiver symbol. if len(n.child[0].child) > 0 { - // define receiver symbol var typ *itype fr := n.child[0].child[0] recvTypeNode := fr.lastChild() @@ -384,8 +447,9 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { sc.sym[fr.child[0].ident] = &symbol{index: index, kind: varSym, typ: typ} } } - for _, c := range n.child[2].child[0].child { - // define input parameter symbols + + // Define input parameter symbols. + for _, c := range n.child[2].child[1].child { var typ *itype if typ, err = nodeType(interp, sc, c.lastChild()); err != nil { return false @@ -394,6 +458,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { sc.sym[cc.ident] = &symbol{index: sc.add(typ), kind: varSym, typ: typ} } } + if n.child[1].ident == "init" && len(n.child[0].child) == 0 { initNodes = append(initNodes, n) } @@ -411,11 +476,11 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { sc.loop = n case importSpec: - // already all done in gta + // Already all done in GTA. return false case typeSpec: - // processing already done in GTA pass for global types, only parses inlined types + // Processing already done in GTA pass for global types, only parses inlined types. if sc.def == nil { return false } @@ -425,13 +490,16 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { return false } if typ.incomplete { - err = n.cfgErrorf("invalid type declaration") - return false + // Type may still be incomplete in case of a local recursive struct declaration. + if typ, err = typ.finalize(); err != nil { + err = n.cfgErrorf("invalid type declaration") + return false + } } switch n.child[1].kind { case identExpr, selectorExpr: - n.typ = &itype{cat: aliasT, val: typ, name: typeName} + n.typ = namedOf(typ, pkgName, typeName) default: n.typ = typ n.typ.name = typeName @@ -444,7 +512,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { // values which may be used in further declarations. if !sc.global { for _, c := range n.child { - if _, err = interp.cfg(c, importPath); err != nil { + if _, err = interp.cfg(c, sc, importPath, pkgName); err != nil { // No error processing here, to allow recovery in subtree nodes. err = nil } @@ -471,6 +539,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { switch n.kind { case addressExpr: + if isBlank(n.child[0]) { + err = n.cfgErrorf("cannot use _ as value") + break + } wireChild(n) err = check.addressExpr(n) @@ -478,7 +550,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { break } - n.typ = &itype{cat: ptrT, val: n.child[0].typ} + n.typ = ptrOf(n.child[0].typ) n.findex = sc.add(n.typ) case assignStmt, defineStmt: @@ -506,6 +578,11 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { updateSym := false var sym *symbol var level int + + if isBlank(src) { + err = n.cfgErrorf("cannot use _ as value") + break + } if n.kind == defineStmt || (n.kind == assignStmt && dest.ident == "_") { if atyp != nil { dest.typ = atyp @@ -514,7 +591,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { return } if src.typ.isBinMethod { - dest.typ = &itype{cat: valueT, rtype: src.typ.methodCallType()} + dest.typ = valueTOf(src.typ.methodCallType()) } else { // In a new definition, propagate the source type to the destination // type. If the source is an untyped constant, make sure that the @@ -525,10 +602,6 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if dest.typ.incomplete { return } - if dest.typ.sizedef { - dest.typ.size = arrayTypeLen(src) - dest.typ.rtype = nil - } if sc.global { // Do not overload existing symbols (defined in GTA) in global scope sym, _, _ = sc.lookup(dest.ident) @@ -562,9 +635,6 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.findex = dest.findex n.level = dest.level - // Propagate type. - // TODO: Check that existing destination type matches source type. - // In the following, we attempt to optimize by skipping the assign // operation and setting the source location directly to the destination // location in the frame. @@ -580,8 +650,12 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { dest.gen = nop case isFuncField(dest): // Setting a struct field of function type requires an extra step. Do not optimize. - case isCall(src) && dest.typ.cat != interfaceT && !isRecursiveField(dest) && n.kind != defineStmt: + case isCall(src) && !isInterfaceSrc(dest.typ) && n.kind != defineStmt: // Call action may perform the assignment directly. + if dest.typ.id() != src.typ.id() { + // Skip optimitization if returned type doesn't match assigned one. + break + } n.gen = nop src.level = level src.findex = dest.findex @@ -598,8 +672,8 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { // Skip optimisation for assigned interface. break } - if dest.action == aGetIndex { - // Skip optimization, as it does not work when assigning to a struct field. + if dest.action == aGetIndex || dest.action == aStar { + // Skip optimization, as it does not work when assigning to a struct field or a dereferenced pointer. break } n.gen = nop @@ -614,6 +688,8 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case src.kind == basicLit: // Assign to nil. src.rval = reflect.New(dest.typ.TypeOf()).Elem() + case n.nright == 0: + n.gen = reset } n.typ = dest.typ @@ -639,6 +715,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } case incDecStmt: + err = check.unaryExpr(n) + if err != nil { + break + } wireChild(n) n.findex = n.child[0].findex n.level = n.child[0].level @@ -659,7 +739,12 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if r := lc.child[0].typ.numOut(); r != l { err = n.cfgErrorf("assignment mismatch: %d variables but %s returns %d values", l, lc.child[0].name(), r) } - n.gen = nop + if isBinCall(lc, sc) { + n.gen = nop + } else { + // TODO (marc): skip if no conversion or wrapping is needed. + n.gen = assignFromCall + } case indexExpr: lc.gen = getIndexMap2 n.gen = nop @@ -733,7 +818,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { // by constOp and available in n.rval. Nothing else to do at execution. n.gen = nop n.findex = notInFrame - case n.anc.kind == assignStmt && n.anc.action == aAssign: + case n.anc.kind == assignStmt && n.anc.action == aAssign && n.anc.nleft == 1: // To avoid a copy in frame, if the result is to be assigned, store it directly // at the frame location of destination. dest := n.anc.child[childPos(n)-n.anc.nright] @@ -752,19 +837,20 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } case indexExpr: + if isBlank(n.child[0]) { + err = n.cfgErrorf("cannot use _ as value") + break + } wireChild(n) t := n.child[0].typ + for t.cat == aliasT { + t = t.val + } switch t.cat { - case aliasT: - if isString(t.val.TypeOf()) { - n.typ = sc.getType("byte") - break - } - fallthrough case ptrT: n.typ = t.val if t.val.cat == valueT { - n.typ = &itype{cat: valueT, rtype: t.val.rtype.Elem()} + n.typ = valueTOf(t.val.rtype.Elem()) } else { n.typ = t.val.val } @@ -774,8 +860,51 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if t.rtype.Kind() == reflect.String { n.typ = sc.getType("byte") } else { - n.typ = &itype{cat: valueT, rtype: t.rtype.Elem()} + n.typ = valueTOf(t.rtype.Elem()) + } + case funcT: + // A function indexed by a type means an instantiated generic function. + c1 := n.child[1] + if !c1.isType(sc) { + n.typ = t + return + } + g, err := genAST(sc, t.node.anc, []*node{c1}) + if err != nil { + return + } + if _, err = interp.cfg(g, nil, importPath, pkgName); err != nil { + return + } + // Generate closures for function body. + if err = genRun(g.child[3]); err != nil { + return + } + // Replace generic func node by instantiated one. + n.anc.child[childPos(n)] = g + n.typ = g.typ + return + case genericT: + name := t.id() + "[" + n.child[1].typ.id() + "]" + sym, _, ok := sc.lookup(name) + if !ok { + err = n.cfgErrorf("type not found: %s", name) + return + } + n.gen = nop + n.typ = sym.typ + return + case structT: + // A struct indexed by a Type means an instantiated generic struct. + name := t.name + "[" + n.child[1].ident + "]" + sym, _, ok := sc.lookup(name) + if ok { + n.typ = sym.typ + n.findex = sc.add(n.typ) + n.gen = nop + return } + default: n.typ = t.val } @@ -842,32 +971,88 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.rval = l.rval case breakStmt: - if len(n.child) > 0 { - gotoLabel(n.sym) - } else { + if len(n.child) == 0 { n.tnext = sc.loop + break } + if !n.hasAnc(n.sym.node) { + err = n.cfgErrorf("invalid break label %s", n.child[0].ident) + break + } + n.tnext = n.sym.node case continueStmt: - if len(n.child) > 0 { - gotoLabel(n.sym) - } else { + if len(n.child) == 0 { n.tnext = sc.loopRestart + break } + if !n.hasAnc(n.sym.node) { + err = n.cfgErrorf("invalid continue label %s", n.child[0].ident) + break + } + n.tnext = n.sym.node.child[1].lastChild().start case gotoStmt: - gotoLabel(n.sym) + if n.sym.node == nil { + // It can be only due to a forward goto, to be resolved at labeledStmt. + // Invalid goto labels are catched at AST parsing. + break + } + n.tnext = n.sym.node.start case labeledStmt: wireChild(n) - n.start = n.child[1].start - gotoLabel(n.sym) + if len(n.child) > 1 { + n.start = n.child[1].start + } + for _, c := range n.sym.from { + c.tnext = n.start // Resolve forward goto. + } case callExpr: + for _, c := range n.child { + if isBlank(c) { + err = n.cfgErrorf("cannot use _ as value") + return + } + } wireChild(n) - switch { - case interp.isBuiltinCall(n): - c0 := n.child[0] + switch c0 := n.child[0]; { + case c0.kind == indexListExpr: + // Instantiate a generic function then call it. + fun := c0.child[0].sym.node + g, err := genAST(sc, fun, c0.child[1:]) + if err != nil { + return + } + _, err = interp.cfg(g, nil, importPath, pkgName) + if err != nil { + return + } + err = genRun(g.child[3]) // Generate closures for function body. + if err != nil { + return + } + n.child[0] = g + c0 = n.child[0] + wireChild(n) + if typ := c0.typ; len(typ.ret) > 0 { + n.typ = typ.ret[0] + if n.anc.kind == returnStmt && n.typ.id() == sc.def.typ.ret[0].id() { + // Store the result directly to the return value area of frame. + // It can be done only if no type conversion at return is involved. + n.findex = childPos(n) + } else { + n.findex = sc.add(n.typ) + for _, t := range typ.ret[1:] { + sc.add(t) + } + } + } else { + n.findex = notInFrame + } + + case isBuiltinCall(n, sc): bname := c0.ident err = check.builtin(bname, n, n.child[1:], n.action == aCallSlice) if err != nil { @@ -887,7 +1072,11 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { // Store result directly to frame output location, to avoid a frame copy. n.findex = 0 case bname == "cap" && isInConstOrTypeDecl(n): - switch n.child[1].typ.TypeOf().Kind() { + t := n.child[1].typ.TypeOf() + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + switch t.Kind() { case reflect.Array, reflect.Chan: capConst(n) default: @@ -896,7 +1085,11 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.findex = notInFrame n.gen = nop case bname == "len" && isInConstOrTypeDecl(n): - switch n.child[1].typ.TypeOf().Kind() { + t := n.child[1].typ.TypeOf() + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + switch t.Kind() { case reflect.Array, reflect.Chan, reflect.String: lenConst(n) default: @@ -910,9 +1103,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if op, ok := constBltn[bname]; ok && n.anc.action != aAssign { op(n) // pre-compute non-assigned constant : } - case n.child[0].isType(sc): + + case c0.isType(sc): // Type conversion expression - c0, c1 := n.child[0], n.child[1] + c1 := n.child[1] switch len(n.child) { case 1: err = n.cfgErrorf("missing argument in conversion to %s", c0.typ.id()) @@ -932,9 +1126,12 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if !c1.typ.implements(c0.typ) { err = n.cfgErrorf("type %v does not implement interface %v", c1.typ.id(), c0.typ.id()) } - // Pass value as is + // Convert type to interface while keeping a reference to the original concrete type. + // besides type, the node value remains preserved. n.gen = nop - n.typ = c1.typ + t := *c0.typ + n.typ = &t + n.typ.val = c1.typ n.findex = c1.findex n.level = c1.level n.val = c1.val @@ -954,16 +1151,17 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.typ = c0.typ n.findex = sc.add(n.typ) } - case isBinCall(n): - err = check.arguments(n, n.child[1:], n.child[0], n.action == aCallSlice) + + case isBinCall(n, sc): + err = check.arguments(n, n.child[1:], c0, n.action == aCallSlice) if err != nil { break } n.gen = callBin - typ := n.child[0].typ.rtype + typ := c0.typ.rtype if typ.NumOut() > 0 { - if funcType := n.child[0].typ.val; funcType != nil { + if funcType := c0.typ.val; funcType != nil { // Use the original unwrapped function type, to allow future field and // methods resolutions, otherwise impossible on the opaque bin type. n.typ = funcType.ret[0] @@ -972,30 +1170,75 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { sc.add(funcType.ret[i]) } } else { - n.typ = &itype{cat: valueT, rtype: typ.Out(0)} + n.typ = valueTOf(typ.Out(0)) if n.anc.kind == returnStmt { n.findex = childPos(n) } else { n.findex = sc.add(n.typ) for i := 1; i < typ.NumOut(); i++ { - sc.add(&itype{cat: valueT, rtype: typ.Out(i)}) + sc.add(valueTOf(typ.Out(i))) } } } } + + case isOffsetof(c0): + if len(n.child) != 2 || n.child[1].kind != selectorExpr || !isStruct(n.child[1].child[0].typ) { + err = n.cfgErrorf("Offsetof argument: invalid expression") + break + } + c1 := n.child[1] + field, ok := c1.child[0].typ.rtype.FieldByName(c1.child[1].ident) + if !ok { + err = n.cfgErrorf("struct does not contain field: %s", c1.child[1].ident) + break + } + n.typ = valueTOf(reflect.TypeOf(field.Offset)) + n.rval = reflect.ValueOf(field.Offset) + n.gen = nop + default: - err = check.arguments(n, n.child[1:], n.child[0], n.action == aCallSlice) + // The call may be on a generic function. In that case, replace the + // generic function AST by an instantiated one before going further. + if isGeneric(c0.typ) { + fun := c0.typ.node.anc + var g *node + var types []*node + + // Infer type parameter from function call arguments. + if types, err = inferTypesFromCall(sc, fun, n.child[1:]); err != nil { + break + } + // Generate an instantiated AST from the generic function one. + if g, err = genAST(sc, fun, types); err != nil { + break + } + // Compile the generated function AST, so it becomes part of the scope. + if _, err = interp.cfg(g, nil, importPath, pkgName); err != nil { + break + } + // AST compilation part 2: Generate closures for function body. + if err = genRun(g.child[3]); err != nil { + break + } + n.child[0] = g + c0 = n.child[0] + } + + err = check.arguments(n, n.child[1:], c0, n.action == aCallSlice) if err != nil { break } - if n.child[0].action == aGetFunc { + if c0.action == aGetFunc { // Allocate a frame entry to store the anonymous function definition. - sc.add(n.child[0].typ) + sc.add(c0.typ) } - if typ := n.child[0].typ; len(typ.ret) > 0 { + if typ := c0.typ; len(typ.ret) > 0 { n.typ = typ.ret[0] - if n.anc.kind == returnStmt { + if n.anc.kind == returnStmt && n.typ.id() == sc.def.typ.ret[0].id() { + // Store the result directly to the return value area of frame. + // It can be done only if no type conversion at return is involved. n.findex = childPos(n) } else { n.findex = sc.add(n.typ) @@ -1052,8 +1295,8 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } switch n.typ.cat { - case arrayT: - err = check.arrayLitExpr(child, n.typ.val, n.typ.size) + case arrayT, sliceT: + err = check.arrayLitExpr(child, n.typ) case mapT: err = check.mapLitExpr(child, n.typ.key, n.typ.val) case structT: @@ -1064,8 +1307,8 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case reflect.Struct: err = check.structBinLitExpr(child, rtype) case reflect.Map: - ktyp := &itype{cat: valueT, rtype: rtype.Key()} - vtyp := &itype{cat: valueT, rtype: rtype.Elem()} + ktyp := valueTOf(rtype.Key()) + vtyp := valueTOf(rtype.Elem()) err = check.mapLitExpr(child, ktyp, vtyp) } } @@ -1206,10 +1449,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case funcDecl: n.start = n.child[3].start - n.types = sc.types + n.types, n.scope = sc.types, sc sc = sc.pop() funcName := n.child[1].ident - if sym := sc.sym[funcName]; !isMethod(n) && sym != nil { + if sym := sc.sym[funcName]; !isMethod(n) && sym != nil && !isGeneric(sym.typ) { sym.index = -1 // to force value to n.val sym.typ = n.typ sym.kind = funcSym @@ -1217,7 +1460,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } case funcLit: - n.types = sc.types + n.types, n.scope = sc.types, sc sc = sc.pop() err = genRun(n) @@ -1243,11 +1486,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } } // Found symbol, populate node info - n.typ, n.findex, n.level = sym.typ, sym.index, level + n.sym, n.typ, n.findex, n.level = sym, sym.typ, sym.index, level if n.findex < 0 { n.val = sym.node } else { - n.sym = sym switch { case sym.kind == constSym && sym.rval.IsValid(): n.rval = sym.rval @@ -1353,9 +1595,17 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { sc = sc.pop() case keyValueExpr: + if isBlank(n.child[1]) { + err = n.cfgErrorf("cannot use _ as value") + break + } wireChild(n) case landExpr: + if isBlank(n.child[0]) || isBlank(n.child[1]) { + err = n.cfgErrorf("cannot use _ as value") + break + } n.start = n.child[0].start n.child[0].tnext = n.child[1].start setFNext(n.child[0], n) @@ -1367,6 +1617,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } case lorExpr: + if isBlank(n.child[0]) || isBlank(n.child[1]) { + err = n.cfgErrorf("cannot use _ as value") + break + } n.start = n.child[0].start n.child[0].tnext = n setFNext(n.child[0], n.child[1].start) @@ -1412,6 +1666,12 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { err = n.cfgErrorf("too many arguments to return") break } + for _, c := range n.child { + if isBlank(c) { + err = n.cfgErrorf("cannot use _ as value") + return + } + } returnSig := sc.def.child[2] if mustReturnValue(returnSig) { nret := len(n.child) @@ -1428,14 +1688,14 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.val = sc.def for i, c := range n.child { var typ *itype - typ, err = nodeType(interp, sc.upperLevel(), returnSig.child[1].fieldType(i)) + typ, err = nodeType(interp, sc.upperLevel(), returnSig.child[2].fieldType(i)) if err != nil { return } // TODO(mpl): move any of that code to typecheck? c.typ.node = c if !c.typ.assignableTo(typ) { - err = fmt.Errorf("cannot use %v (type %v) as type %v in return argument", c.ident, c.typ.cat, typ.cat) + err = c.cfgErrorf("cannot use %v (type %v) as type %v in return argument", c.ident, c.typ.cat, typ.cat) return } if c.typ.cat == nilT { @@ -1457,80 +1717,16 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { err = n.cfgErrorf("undefined type") break } - if n.typ.cat == valueT || n.typ.cat == errorT { - // Handle object defined in runtime, try to find field or method - // Search for method first, as it applies both to types T and *T - // Search for field must then be performed on type T only (not *T) - switch method, ok := n.typ.rtype.MethodByName(n.child[1].ident); { - case ok: - hasRecvType := n.typ.rtype.Kind() != reflect.Interface - n.val = method.Index - n.gen = getIndexBinMethod - n.action = aGetMethod - n.recv = &receiver{node: n.child[0]} - n.typ = &itype{cat: valueT, rtype: method.Type, isBinMethod: true} - if hasRecvType { - n.typ.recv = n.typ - } - case n.typ.rtype.Kind() == reflect.Ptr: - if field, ok := n.typ.rtype.Elem().FieldByName(n.child[1].ident); ok { - n.typ = &itype{cat: valueT, rtype: field.Type} - n.val = field.Index - n.gen = getPtrIndexSeq - } else { - err = n.cfgErrorf("undefined field or method: %s", n.child[1].ident) - } - case n.typ.rtype.Kind() == reflect.Struct: - if field, ok := n.typ.rtype.FieldByName(n.child[1].ident); ok { - n.typ = &itype{cat: valueT, rtype: field.Type} - n.val = field.Index - n.gen = getIndexSeq - } else { - // method lookup failed on type, now lookup on pointer to type - pt := reflect.PtrTo(n.typ.rtype) - if m2, ok2 := pt.MethodByName(n.child[1].ident); ok2 { - n.val = m2.Index - n.gen = getIndexBinPtrMethod - n.typ = &itype{cat: valueT, rtype: m2.Type, recv: &itype{cat: valueT, rtype: pt}} - n.recv = &receiver{node: n.child[0]} - n.action = aGetMethod - } else { - err = n.cfgErrorf("undefined field or method: %s", n.child[1].ident) - } - } - default: - err = n.cfgErrorf("undefined field or method: %s", n.child[1].ident) - } - } else if n.typ.cat == ptrT && (n.typ.val.cat == valueT || n.typ.val.cat == errorT) { - // Handle pointer on object defined in runtime - if method, ok := n.typ.val.rtype.MethodByName(n.child[1].ident); ok { - n.val = method.Index - n.typ = &itype{cat: valueT, rtype: method.Type, recv: n.typ} - n.recv = &receiver{node: n.child[0]} - n.gen = getIndexBinMethod - n.action = aGetMethod - } else if method, ok := reflect.PtrTo(n.typ.val.rtype).MethodByName(n.child[1].ident); ok { - n.val = method.Index - n.gen = getIndexBinMethod - n.typ = &itype{cat: valueT, rtype: method.Type, recv: &itype{cat: valueT, rtype: reflect.PtrTo(n.typ.val.rtype)}} - n.recv = &receiver{node: n.child[0]} - n.action = aGetMethod - } else if field, ok := n.typ.val.rtype.FieldByName(n.child[1].ident); ok { - n.typ = &itype{cat: valueT, rtype: field.Type} - n.val = field.Index - n.gen = getPtrIndexSeq - } else { - err = n.cfgErrorf("undefined selector: %s", n.child[1].ident) - } - } else if n.typ.cat == binPkgT { + switch { + case n.typ.cat == binPkgT: // Resolve binary package symbol: a type or a value name := n.child[1].ident pkg := n.child[0].sym.typ.path if s, ok := interp.binPkg[pkg][name]; ok { if isBinType(s) { - n.typ = &itype{cat: valueT, rtype: s.Type().Elem()} + n.typ = valueTOf(s.Type().Elem()) } else { - n.typ = &itype{cat: valueT, rtype: s.Type(), untyped: isValueUntyped(s)} + n.typ = valueTOf(fixPossibleConstType(s.Type()), withUntyped(isValueUntyped(s))) n.rval = s } n.action = aGetSym @@ -1538,7 +1734,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } else { err = n.cfgErrorf("package %s \"%s\" has no symbol %s", n.child[0].ident, pkg, name) } - } else if n.typ.cat == srcPkgT { + case n.typ.cat == srcPkgT: pkg, name := n.child[0].sym.typ.path, n.child[1].ident // Resolve source package symbol if sym, ok := interp.srcPkg[pkg][name]; ok { @@ -1551,70 +1747,170 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { n.action = aGetSym n.typ = sym.typ n.sym = sym + n.recv = sym.recv n.rval = sym.rval } else { err = n.cfgErrorf("undefined selector: %s.%s", pkg, name) } - } else if m, lind := n.typ.lookupMethod(n.child[1].ident); m != nil { - n.action = aGetMethod - if n.child[0].isType(sc) { - // Handle method as a function with receiver in 1st argument - n.val = m - n.findex = notInFrame - n.gen = nop - n.typ = &itype{} - *n.typ = *m.typ - n.typ.arg = append([]*itype{n.child[0].typ}, m.typ.arg...) - } else { - // Handle method with receiver - n.gen = getMethod - n.val = m - n.typ = m.typ - n.recv = &receiver{node: n.child[0], index: lind} + case isStruct(n.typ) || isInterfaceSrc(n.typ): + // Find a matching field. + if ti := n.typ.lookupField(n.child[1].ident); len(ti) > 0 { + if isStruct(n.typ) { + // If a method of the same name exists, use it if it is shallower than the struct field. + // if method's depth is the same as field's, this is an error. + d := n.typ.methodDepth(n.child[1].ident) + if d >= 0 && d < len(ti) { + goto tryMethods + } + if d == len(ti) { + err = n.cfgErrorf("ambiguous selector: %s", n.child[1].ident) + break + } + } + n.val = ti + switch { + case isInterfaceSrc(n.typ): + n.typ = n.typ.fieldSeq(ti) + n.gen = getMethodByName + n.action = aMethod + case n.typ.cat == ptrT: + n.typ = n.typ.fieldSeq(ti) + n.gen = getPtrIndexSeq + if n.typ.cat == funcT { + // Function in a struct field is always wrapped in reflect.Value. + n.typ = wrapperValueTOf(n.typ.TypeOf(), n.typ) + } + default: + n.gen = getIndexSeq + n.typ = n.typ.fieldSeq(ti) + if n.typ.cat == funcT { + // Function in a struct field is always wrapped in reflect.Value. + n.typ = wrapperValueTOf(n.typ.TypeOf(), n.typ) + } + } + break } - } else if m, lind, isPtr, ok := n.typ.lookupBinMethod(n.child[1].ident); ok { - n.action = aGetMethod - if isPtr && n.typ.fieldSeq(lind).cat != ptrT { - n.gen = getIndexSeqPtrMethod - } else { - n.gen = getIndexSeqMethod - } - n.recv = &receiver{node: n.child[0], index: lind} - n.val = append([]int{m.Index}, lind...) - n.typ = &itype{cat: valueT, rtype: m.Type, recv: n.child[0].typ} - } else if ti := n.typ.lookupField(n.child[1].ident); len(ti) > 0 { - // Handle struct field - n.val = ti - switch { - case isInterfaceSrc(n.typ): - n.typ = n.typ.fieldSeq(ti) - n.gen = getMethodByName - n.action = aMethod - case n.typ.cat == ptrT: - n.typ = n.typ.fieldSeq(ti) - n.gen = getPtrIndexSeq - if n.typ.cat == funcT { - // function in a struct field is always wrapped in reflect.Value - rtype := n.typ.TypeOf() - n.typ = &itype{cat: valueT, rtype: rtype, val: n.typ} + if s, lind, ok := n.typ.lookupBinField(n.child[1].ident); ok { + // Handle an embedded binary field into a struct field. + n.gen = getIndexSeqField + lind = append(lind, s.Index...) + if isStruct(n.typ) { + // If a method of the same name exists, use it if it is shallower than the struct field. + // if method's depth is the same as field's, this is an error. + d := n.typ.methodDepth(n.child[1].ident) + if d >= 0 && d < len(lind) { + goto tryMethods + } + if d == len(lind) { + err = n.cfgErrorf("ambiguous selector: %s", n.child[1].ident) + break + } } - default: - n.gen = getIndexSeq - n.typ = n.typ.fieldSeq(ti) - if n.typ.cat == funcT { - // function in a struct field is always wrapped in reflect.Value - rtype := n.typ.TypeOf() - n.typ = &itype{cat: valueT, rtype: rtype, val: n.typ} + n.val = lind + n.typ = valueTOf(s.Type) + break + } + // No field (embedded or not) matched. Try to match a method. + tryMethods: + fallthrough + default: + // Find a matching method. + // TODO (marc): simplify the following if/elseif blocks. + if n.typ.cat == valueT || n.typ.cat == errorT { + switch method, ok := n.typ.rtype.MethodByName(n.child[1].ident); { + case ok: + hasRecvType := n.typ.TypeOf().Kind() != reflect.Interface + n.val = method.Index + n.gen = getIndexBinMethod + n.action = aGetMethod + n.recv = &receiver{node: n.child[0]} + n.typ = valueTOf(method.Type, isBinMethod()) + if hasRecvType { + n.typ.recv = n.typ + } + case n.typ.TypeOf().Kind() == reflect.Ptr: + if field, ok := n.typ.rtype.Elem().FieldByName(n.child[1].ident); ok { + n.typ = valueTOf(field.Type) + n.val = field.Index + n.gen = getPtrIndexSeq + break + } + err = n.cfgErrorf("undefined field or method: %s", n.child[1].ident) + case n.typ.TypeOf().Kind() == reflect.Struct: + if field, ok := n.typ.rtype.FieldByName(n.child[1].ident); ok { + n.typ = valueTOf(field.Type) + n.val = field.Index + n.gen = getIndexSeq + break + } + fallthrough + default: + // method lookup failed on type, now lookup on pointer to type + pt := reflect.PtrTo(n.typ.rtype) + if m2, ok2 := pt.MethodByName(n.child[1].ident); ok2 { + n.val = m2.Index + n.gen = getIndexBinPtrMethod + n.typ = valueTOf(m2.Type, isBinMethod(), withRecv(valueTOf(pt))) + n.recv = &receiver{node: n.child[0]} + n.action = aGetMethod + break + } + err = n.cfgErrorf("undefined field or method: %s", n.child[1].ident) + } + } else if n.typ.cat == ptrT && (n.typ.val.cat == valueT || n.typ.val.cat == errorT) { + // Handle pointer on object defined in runtime + if method, ok := n.typ.val.rtype.MethodByName(n.child[1].ident); ok { + n.val = method.Index + n.typ = valueTOf(method.Type, isBinMethod(), withRecv(n.typ)) + n.recv = &receiver{node: n.child[0]} + n.gen = getIndexBinElemMethod + n.action = aGetMethod + } else if method, ok := reflect.PtrTo(n.typ.val.rtype).MethodByName(n.child[1].ident); ok { + n.val = method.Index + n.gen = getIndexBinMethod + n.typ = valueTOf(method.Type, withRecv(valueTOf(reflect.PtrTo(n.typ.val.rtype), isBinMethod()))) + n.recv = &receiver{node: n.child[0]} + n.action = aGetMethod + } else if field, ok := n.typ.val.rtype.FieldByName(n.child[1].ident); ok { + n.typ = valueTOf(field.Type) + n.val = field.Index + n.gen = getPtrIndexSeq + } else { + err = n.cfgErrorf("undefined selector: %s", n.child[1].ident) + } + } else if m, lind := n.typ.lookupMethod(n.child[1].ident); m != nil { + n.action = aGetMethod + if n.child[0].isType(sc) { + // Handle method as a function with receiver in 1st argument. + n.val = m + n.findex = notInFrame + n.gen = nop + n.typ = &itype{} + *n.typ = *m.typ + n.typ.arg = append([]*itype{n.child[0].typ}, m.typ.arg...) + } else { + // Handle method with receiver. + n.gen = getMethod + n.val = m + n.typ = m.typ + n.recv = &receiver{node: n.child[0], index: lind} } + } else if m, lind, isPtr, ok := n.typ.lookupBinMethod(n.child[1].ident); ok { + n.action = aGetMethod + switch { + case isPtr && n.typ.fieldSeq(lind).cat != ptrT: + n.gen = getIndexSeqPtrMethod + case isInterfaceSrc(n.typ): + n.gen = getMethodByName + default: + n.gen = getIndexSeqMethod + } + n.recv = &receiver{node: n.child[0], index: lind} + n.val = append([]int{m.Index}, lind...) + n.typ = valueTOf(m.Type, isBinMethod(), withRecv(n.child[0].typ)) + } else { + err = n.cfgErrorf("undefined selector: %s", n.child[1].ident) } - } else if s, lind, ok := n.typ.lookupBinField(n.child[1].ident); ok { - // Handle an embedded binary field into a struct field - n.gen = getIndexSeqField - lind = append(lind, s.Index...) - n.val = lind - n.typ = &itype{cat: valueT, rtype: s.Type} - } else { - err = n.cfgErrorf("undefined selector: %s", n.child[1].ident) } if err == nil && n.findex != -1 { n.findex = sc.add(n.typ) @@ -1667,6 +1963,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } case starExpr: + if isBlank(n.child[0]) { + err = n.cfgErrorf("cannot use _ as value") + break + } switch { case n.anc.kind == defineStmt && len(n.anc.child) == 3 && n.anc.child[1] == n: // pointer type expression in a var definition @@ -1680,7 +1980,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case n.child[0].isType(sc): // pointer type expression n.gen = nop - n.typ = &itype{cat: ptrT, val: n.child[0].typ} + n.typ = ptrOf(n.child[0].typ) default: // dereference expression wireChild(n) @@ -1691,7 +1991,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { } if c0 := n.child[0]; c0.typ.cat == valueT { - n.typ = &itype{cat: valueT, rtype: c0.typ.rtype.Elem()} + n.typ = valueTOf(c0.typ.rtype.Elem()) } else { n.typ = c0.typ.val } @@ -1723,15 +2023,17 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { break } // Chain case clauses. - for i, c := range clauses[:l-1] { - // Chain to next clause. - setFNext(c, clauses[i+1]) + for i := l - 1; i >= 0; i-- { + c := clauses[i] if len(c.child) == 0 { c.tnext = n // Clause body is empty, exit. } else { body := c.lastChild() c.tnext = body.start - if len(body.child) > 0 && body.lastChild().kind == fallthroughtStmt { + c.child[0].tnext = c + c.start = c.child[0].start + + if i < l-1 && len(body.child) > 0 && body.lastChild().kind == fallthroughtStmt { if n.kind == typeSwitch { err = body.lastChild().cfgErrorf("cannot fallthrough in type switch") } @@ -1744,18 +2046,27 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { body.tnext = n // Exit switch at end of clause body. } } + + if i == l-1 { + setFNext(clauses[i], n) + continue + } + if len(clauses[i+1].child) > 1 { + setFNext(c, clauses[i+1].start) + } else { + setFNext(c, clauses[i+1]) + } } - c := clauses[l-1] // Last clause. - c.fnext = n - if len(c.child) == 0 { - c.tnext = n // Clause body is empty, exit. + sbn.start = clauses[0].start + n.start = n.child[0].start + if n.kind == typeSwitch { + // Handle the typeSwitch init (the type assert expression). + init := n.child[1].lastChild().child[0] + init.tnext = sbn.start + n.child[0].tnext = init.start } else { - body := c.lastChild() - c.tnext = body.start - body.tnext = n + n.child[0].tnext = sbn.start } - n.start = n.child[0].start - n.child[0].tnext = sbn.start case switchIfStmt: // like an if-else chain sc = sc.pop() @@ -1808,6 +2119,10 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { wireChild(n) c0, c1 := n.child[0], n.child[1] + if isBlank(c0) || isBlank(c1) { + err = n.cfgErrorf("cannot use _ as value") + break + } if c1.typ == nil { if c1.typ, err = nodeType(interp, sc, c1); err != nil { return @@ -1822,7 +2137,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if n.anc.action != aAssignX { if c0.typ.cat == valueT && isFunc(c1.typ) { // Avoid special wrapping of interfaces and func types. - n.typ = &itype{cat: valueT, rtype: c1.typ.TypeOf()} + n.typ = valueTOf(c1.typ.TypeOf()) } else { n.typ = c1.typ } @@ -1854,7 +2169,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { if n.action == aRecv { // Channel receive operation: set type to the channel data type if n.typ.cat == valueT { - n.typ = &itype{cat: valueT, rtype: n.typ.rtype.Elem()} + n.typ = valueTOf(n.typ.rtype.Elem()) } else { n.typ = n.typ.val } @@ -1874,7 +2189,7 @@ func (interp *Interpreter) cfg(root *node, importPath string) ([]*node, error) { case n.rval.IsValid(): n.gen = nop n.findex = notInFrame - case n.anc.kind == assignStmt && n.anc.action == aAssign: + case n.anc.kind == assignStmt && n.anc.action == aAssign && n.anc.nright == 1: dest := n.anc.child[childPos(n)-n.anc.nright] n.typ = dest.typ n.findex = dest.findex @@ -1938,18 +2253,23 @@ func compDefineX(sc *scope, n *node) error { if funtype.cat == valueT { // Handle functions imported from runtime. for i := 0; i < funtype.rtype.NumOut(); i++ { - types = append(types, &itype{cat: valueT, rtype: funtype.rtype.Out(i)}) + types = append(types, valueTOf(funtype.rtype.Out(i))) } } else { types = funtype.ret } - if n.child[l-1].isType(sc) { + if n.anc.kind == varDecl && n.child[l-1].isType(sc) { l-- } if len(types) != l { return n.cfgErrorf("assignment mismatch: %d variables but %s returns %d values", l, src.child[0].name(), len(types)) } - n.gen = nop + if isBinCall(src, sc) { + n.gen = nop + } else { + // TODO (marc): skip if no conversion or wrapping is needed. + n.gen = assignFromCall + } case indexExpr: types = append(types, src.typ, sc.getType("bool")) @@ -1976,13 +2296,44 @@ func compDefineX(sc *scope, n *node) error { return n.cfgErrorf("unsupported assign expression") } + // Handle redeclarations: find out new symbols vs existing ones. + symIsNew := map[string]bool{} + hasNewSymbol := false + for i := range types { + id := n.child[i].ident + if id == "_" || id == "" { + continue + } + if _, found := symIsNew[id]; found { + return n.cfgErrorf("%s repeated on left side of :=", id) + } + // A new symbol doesn't exist in current scope. Upper scopes are not + // taken into accout here, as a new symbol can shadow an existing one. + if _, found := sc.sym[id]; found { + symIsNew[id] = false + } else { + symIsNew[id] = true + hasNewSymbol = true + } + } + for i, t := range types { - index := sc.add(t) - sc.sym[n.child[i].ident] = &symbol{index: index, kind: varSym, typ: t} + var index int + id := n.child[i].ident + // A variable can be redeclared if at least one other not blank variable is created. + // The redeclared variable must be of same type (it is reassigned, not created). + // Careful to not reuse a variable which has been shadowed (it must not be a newSym). + sym, level, ok := sc.lookup(id) + canRedeclare := hasNewSymbol && len(symIsNew) > 1 && !symIsNew[id] && ok + if canRedeclare && level == n.child[i].level && sym.kind == varSym && sym.typ.id() == t.id() { + index = sym.index + } else { + index = sc.add(t) + sc.sym[id] = &symbol{index: index, kind: varSym, typ: t} + } n.child[i].typ = t n.child[i].findex = index } - return nil } @@ -2109,15 +2460,22 @@ func genGlobalVarDecl(nodes []*node, sc *scope) (*node, error) { func getVarDependencies(nod *node, sc *scope) (deps []*node) { nod.Walk(func(n *node) bool { - if n.kind == identExpr { - if sym, _, ok := sc.lookup(n.ident); ok { - if sym.kind != varSym || !sym.global || sym.node == nod { - return false - } - deps = append(deps, sym.node) - } + if n.kind != identExpr { + return true } - return true + // Process ident nodes, and avoid false dependencies. + if n.anc.kind == selectorExpr && childPos(n) == 1 { + return false + } + sym, _, ok := sc.lookup(n.ident) + if !ok { + return false + } + if sym.kind != varSym || !sym.global || sym.node == nod { + return false + } + deps = append(deps, sym.node) + return false }, nil) return deps } @@ -2169,7 +2527,10 @@ func (n *node) isType(sc *scope) bool { suffixedPkg := filepath.Join(pkg, baseName) sym, _, ok := sc.lookup(suffixedPkg) if !ok { - return false + sym, _, ok = sc.lookup(pkg) + if !ok { + return false + } } if sym.kind != pkgSym { return false @@ -2183,6 +2544,10 @@ func (n *node) isType(sc *scope) bool { } case identExpr: return sc.getType(n.ident) != nil + case indexExpr: + // Maybe a generic type. + sym, _, ok := sc.lookup(n.child[0].ident) + return ok && sym.kind == typeSym } return false } @@ -2333,6 +2698,15 @@ func (n *node) fieldType(m int) *node { // lastChild returns the last child of a node. func (n *node) lastChild() *node { return n.child[len(n.child)-1] } +func (n *node) hasAnc(nod *node) bool { + for a := n.anc; a != nil; a = a.anc { + if a == nod { + return true + } + } + return false +} + func isKey(n *node) bool { return n.anc.kind == fileStmt || (n.anc.kind == selectorExpr && n.anc.child[0] != n) || @@ -2345,16 +2719,13 @@ func isField(n *node) bool { return n.kind == selectorExpr && len(n.child) > 0 && n.child[0].typ != nil && isStruct(n.child[0].typ) } -func isRecursiveField(n *node) bool { - if !isField(n) { - return false - } - t := n.typ - for t != nil { - if t.recursive { +func isInInterfaceType(n *node) bool { + anc := n.anc + for anc != nil { + if anc.kind == interfaceType { return true } - t = t.val + anc = anc.anc } return false } @@ -2363,7 +2734,7 @@ func isInConstOrTypeDecl(n *node) bool { anc := n.anc for anc != nil { switch anc.kind { - case constDecl, typeDecl: + case constDecl, typeDecl, arrayType, chanType: return true case varDecl, funcDecl: return false @@ -2409,15 +2780,30 @@ func isCall(n *node) bool { return n.action == aCall || n.action == aCallSlice } -func isBinCall(n *node) bool { - return isCall(n) && n.child[0].typ.cat == valueT && n.child[0].typ.rtype.Kind() == reflect.Func +func isBinCall(n *node, sc *scope) bool { + if !isCall(n) || len(n.child) == 0 { + return false + } + c0 := n.child[0] + if c0.typ == nil { + // If called early in parsing, child type may not be known yet. + c0.typ, _ = nodeType(n.interp, sc, c0) + if c0.typ == nil { + return false + } + } + return c0.typ.cat == valueT && c0.typ.rtype.Kind() == reflect.Func +} + +func isOffsetof(n *node) bool { + return n.typ != nil && n.typ.cat == valueT && n.rval.String() == "Offsetof" } func mustReturnValue(n *node) bool { - if len(n.child) < 2 { + if len(n.child) < 3 { return false } - for _, f := range n.child[1].child { + for _, f := range n.child[2].child { if len(f.child) > 1 { return false } @@ -2498,20 +2884,11 @@ func typeSwichAssign(n *node) bool { return ts.kind == typeSwitch && ts.child[1].action == aAssign } -func gotoLabel(s *symbol) { - if s.node == nil { - return - } - for _, c := range s.from { - c.tnext = s.node.start - } -} - func compositeGenerator(n *node, typ *itype, rtyp reflect.Type) (gen bltnGenerator) { switch typ.cat { case aliasT, ptrT: - gen = compositeGenerator(n, n.typ.val, rtyp) - case arrayT: + gen = compositeGenerator(n, typ.val, rtyp) + case arrayT, sliceT: gen = arrayLit case mapT: gen = mapLit @@ -2534,11 +2911,7 @@ func compositeGenerator(n *node, typ *itype, rtyp reflect.Type) (gen bltnGenerat } case valueT: if rtyp == nil { - rtyp = n.typ.rtype - } - // TODO(mpl): I do not understand where this side-effect is coming from, and why it happens. quickfix for now. - if rtyp == nil { - rtyp = n.typ.val.rtype + rtyp = n.typ.TypeOf() } switch k := rtyp.Kind(); k { case reflect.Struct: @@ -2552,7 +2925,7 @@ func compositeGenerator(n *node, typ *itype, rtyp reflect.Type) (gen bltnGenerat gen = compositeBinMap case reflect.Ptr: gen = compositeGenerator(n, typ, n.typ.val.rtype) - case reflect.Slice: + case reflect.Slice, reflect.Array: gen = compositeBinSlice default: log.Panic(n.cfgErrorf("compositeGenerator not implemented for type kind: %s", k)) @@ -2564,23 +2937,54 @@ func compositeGenerator(n *node, typ *itype, rtyp reflect.Type) (gen bltnGenerat // arrayTypeLen returns the node's array length. If the expression is an // array variable it is determined from the value's type, otherwise it is // computed from the source definition. -func arrayTypeLen(n *node) int { - if n.typ != nil && n.typ.sizedef { - return n.typ.size +func arrayTypeLen(n *node, sc *scope) (int, error) { + if n.typ != nil && n.typ.cat == arrayT { + return n.typ.length, nil } max := -1 - for i, c := range n.child[1:] { - r := i - if c.kind == keyValueExpr { - if v := c.child[0].rval; v.IsValid() { - r = int(c.child[0].rval.Int()) + for _, c := range n.child[1:] { + var r int + + if c.kind != keyValueExpr { + r = max + 1 + max = r + continue + } + + c0 := c.child[0] + v := c0.rval + if v.IsValid() { + r = int(v.Int()) + } else { + // Resolve array key value as a constant. + if c0.kind == identExpr { + // Key is defined by a symbol which must be a constant integer. + sym, _, ok := sc.lookup(c0.ident) + if !ok { + return 0, c0.cfgErrorf("undefined: %s", c0.ident) + } + if sym.kind != constSym { + return 0, c0.cfgErrorf("non-constant array bound %q", c0.ident) + } + r = int(vInt(sym.rval)) + } else { + // Key is defined by a numeric constant expression. + if _, err := c0.interp.cfg(c0, sc, sc.pkgID, sc.pkgName); err != nil { + return 0, err + } + cv, ok := c0.rval.Interface().(constant.Value) + if !ok { + return 0, c0.cfgErrorf("non-constant expression") + } + r = constToInt(cv) } } + if r > max { max = r } } - return max + 1 + return max + 1, nil } // isValueUntyped returns true if value is untyped. @@ -2608,3 +3012,10 @@ func isBoolAction(n *node) bool { } return false } + +func isBlank(n *node) bool { + if n.kind == parenExpr && len(n.child) > 0 { + return isBlank(n.child[0]) + } + return n.ident == "_" +} diff --git a/vendor/github.com/traefik/yaegi/interp/debugger.go b/vendor/github.com/traefik/yaegi/interp/debugger.go new file mode 100644 index 0000000..8b68589 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/debugger.go @@ -0,0 +1,730 @@ +package interp + +import ( + "context" + "errors" + "fmt" + "go/token" + "reflect" + "sort" + "sync" +) + +var ( + // ErrNotLive indicates that the specified ID does not refer to a (live) Go + // routine. + ErrNotLive = errors.New("not live") + + // ErrRunning indicates that the specified Go routine is running. + ErrRunning = errors.New("running") + + // ErrNotRunning indicates that the specified Go routine is running. + ErrNotRunning = errors.New("not running") +) + +var rNodeType = reflect.TypeOf((*node)(nil)).Elem() + +// A Debugger can be used to debug a Yaegi program. +type Debugger struct { + interp *Interpreter + events func(*DebugEvent) + context context.Context + cancel context.CancelFunc + + gWait *sync.WaitGroup + gLock *sync.Mutex + gID int + gLive map[int]*debugRoutine + + result reflect.Value + err error +} + +// go routine debug state. +type debugRoutine struct { + id int + + mode DebugEventReason + running bool + resume chan struct{} + + fDepth int + fStep int +} + +// node debug state. +type nodeDebugData struct { + program *Program + breakOnLine bool + breakOnCall bool +} + +// frame debug state. +type frameDebugData struct { + g *debugRoutine + node *node + name string + kind frameKind + scope *scope +} + +// frame kind. +type frameKind int + +const ( + // interpreter root frame. + frameRoot frameKind = iota + 1 + + // function call frame. + frameCall + + // closure capture frame. + frameClosure +) + +// DebugOptions are the debugger options. +type DebugOptions struct { + // If true, Go routine IDs start at 1 instead of 0. + GoRoutineStartAt1 bool +} + +// A DebugEvent is an event generated by a debugger. +type DebugEvent struct { + debugger *Debugger + reason DebugEventReason + frame *frame +} + +// DebugFrame provides access to stack frame information while debugging a +// program. +type DebugFrame struct { + event *DebugEvent + frames []*frame +} + +// DebugFrameScope provides access to scoped variables while debugging a +// program. +type DebugFrameScope struct { + frame *frame +} + +// DebugVariable is the name and value of a variable from a debug session. +type DebugVariable struct { + Name string + Value reflect.Value +} + +// DebugGoRoutine provides access to information about a Go routine while +// debugging a program. +type DebugGoRoutine struct { + id int +} + +// Breakpoint is the result of attempting to set a breakpoint. +type Breakpoint struct { + // Valid indicates whether the breakpoint was successfully set. + Valid bool + + // Position indicates the source position of the breakpoint. + Position token.Position +} + +// DebugEventReason is the reason a debug event occurred. +type DebugEventReason int + +const ( + // continue execution normally. + debugRun DebugEventReason = iota + + // DebugPause is emitted when a pause request is completed. Can be used with + // Interrupt to request a pause. + DebugPause + + // DebugBreak is emitted when a debug target hits a breakpoint. + DebugBreak + + // DebugEntry is emitted when a debug target starts executing. Can be used + // with Step to produce a corresponding event when execution starts. + DebugEntry + + // DebugStepInto is emitted when a stepInto request is completed. Can be + // used with Step or Interrupt to request a stepInto. + DebugStepInto + + // DebugStepOver is emitted when a stepOver request is completed. Can be + // used with Step or Interrupt to request a stepOver. + DebugStepOver + + // DebugStepOut is emitted when a stepOut request is completed. Can be used + // with Step or Interrupt to request a stepOut. + DebugStepOut + + // DebugTerminate is emitted when a debug target terminates. Can be used + // with Interrupt to attempt to terminate the program. + DebugTerminate + + // DebugEnterGoRoutine is emitted when a Go routine is entered. + DebugEnterGoRoutine + + // DebugExitGoRoutine is emitted when a Go routine is exited. + DebugExitGoRoutine +) + +// Debug initializes a debugger for the given program. +// +// The program will not start running until Step or Continue has been called. If +// Step is called with DebugEntry, an entry event will be generated before the +// first statement is executed. Otherwise, the debugger will behave as usual. +func (interp *Interpreter) Debug(ctx context.Context, prog *Program, events func(*DebugEvent), opts *DebugOptions) *Debugger { + dbg := new(Debugger) + dbg.interp = interp + dbg.events = events + dbg.context, dbg.cancel = context.WithCancel(ctx) + dbg.gWait = new(sync.WaitGroup) + dbg.gLock = new(sync.Mutex) + dbg.gLive = make(map[int]*debugRoutine, 1) + + if opts == nil { + opts = new(DebugOptions) + } + if opts.GoRoutineStartAt1 { + dbg.gID = 1 + } + + mainG := dbg.enterGoRoutine() + mainG.mode = DebugEntry + + interp.debugger = dbg + interp.frame.debug = &frameDebugData{kind: frameRoot, g: mainG} + + prog.root.Walk(func(n *node) bool { + n.setProgram(prog) + return true + }, nil) + + go func() { + defer func() { interp.debugger = nil }() + defer events(&DebugEvent{reason: DebugTerminate}) + defer dbg.cancel() + + <-mainG.resume + dbg.events(&DebugEvent{dbg, DebugEnterGoRoutine, interp.frame}) + dbg.result, dbg.err = interp.ExecuteWithContext(ctx, prog) + dbg.exitGoRoutine(mainG) + dbg.events(&DebugEvent{dbg, DebugExitGoRoutine, interp.frame}) + dbg.gWait.Wait() + }() + + return dbg +} + +// Wait blocks until all Go routines launched by the program have terminated. +// Wait returns the results of `(*Interpreter).Execute`. +func (dbg *Debugger) Wait() (reflect.Value, error) { + <-dbg.context.Done() + return dbg.result, dbg.err +} + +// mark entry into a go routine. +func (dbg *Debugger) enterGoRoutine() *debugRoutine { + g := new(debugRoutine) + g.resume = make(chan struct{}) + + dbg.gWait.Add(1) + + dbg.gLock.Lock() + g.id = dbg.gID + dbg.gID++ + dbg.gLive[g.id] = g + dbg.gLock.Unlock() + + return g +} + +// mark exit from a go routine. +func (dbg *Debugger) exitGoRoutine(g *debugRoutine) { + dbg.gLock.Lock() + delete(dbg.gLive, g.id) + dbg.gLock.Unlock() + + dbg.gWait.Done() +} + +// get the state for a given go routine, if it's live. +func (dbg *Debugger) getGoRoutine(id int) (*debugRoutine, bool) { + dbg.gLock.Lock() + g, ok := dbg.gLive[id] + dbg.gLock.Unlock() + return g, ok +} + +// mark entry into a function call. +func (dbg *Debugger) enterCall(nFunc, nCall *node, f *frame) { + if f.debug != nil { + f.debug.g.fDepth++ + return + } + + f.debug = new(frameDebugData) + f.debug.g = f.anc.debug.g + f.debug.scope = nFunc.scope + + switch nFunc.kind { + case funcLit: + f.debug.kind = frameCall + if nFunc.frame != nil { + nFunc.frame.debug.kind = frameClosure + nFunc.frame.debug.node = nFunc + } + + case funcDecl: + f.debug.kind = frameCall + f.debug.name = nFunc.child[1].ident + } + + if nCall != nil && nCall.anc.kind == goStmt { + f.debug.g = dbg.enterGoRoutine() + dbg.events(&DebugEvent{dbg, DebugEnterGoRoutine, f}) + } + + f.debug.g.fDepth++ +} + +// mark exit from a function call. +func (dbg *Debugger) exitCall(nFunc, nCall *node, f *frame) { + _ = nFunc // ignore unused, so exitCall can have the same signature as enterCall + + f.debug.g.fDepth-- + + if nCall != nil && nCall.anc.kind == goStmt { + dbg.exitGoRoutine(f.debug.g) + dbg.events(&DebugEvent{dbg, DebugExitGoRoutine, f}) + } +} + +// called by the interpreter prior to executing the node. +func (dbg *Debugger) exec(n *node, f *frame) (stop bool) { + f.debug.node = n + + if n != nil && n.pos == token.NoPos { + return false + } + + g := f.debug.g + defer func() { g.running = true }() + + e := &DebugEvent{dbg, g.mode, f} + switch { + case g.mode == DebugTerminate: + dbg.cancel() + return true + + case n.shouldBreak(): + e.reason = DebugBreak + + case g.mode == debugRun: + return false + + case g.mode == DebugStepOut: + if g.fDepth >= g.fStep { + return false + } + + case g.mode == DebugStepOver: + if g.fDepth > g.fStep { + return false + } + } + dbg.events(e) + + g.running = false + select { + case <-g.resume: + return false + case <-dbg.context.Done(): + return true + } +} + +// Continue continues execution of the specified Go routine. Continue returns +// ErrNotLive if there is no Go routine with the corresponding ID, or if it is not +// live. +func (dbg *Debugger) Continue(id int) error { + g, ok := dbg.getGoRoutine(id) + if !ok { + return ErrNotLive + } + + g.mode = debugRun + g.resume <- struct{}{} + return nil +} + +// update the exec mode of this routine. +func (g *debugRoutine) setMode(reason DebugEventReason) { + if g.mode == DebugTerminate { + return + } + + if g.mode == DebugEntry && reason == DebugEntry { + return + } + + switch reason { + case DebugStepInto, DebugStepOver, DebugStepOut: + g.mode, g.fStep = reason, g.fDepth + default: + g.mode = DebugPause + } +} + +// Step issues a stepInto, stepOver, or stepOut request to a stopped Go routine. +// Step returns ErrRunning if the Go routine is running. Step returns ErrNotLive +// if there is no Go routine with the corresponding ID, or if it is not live. +func (dbg *Debugger) Step(id int, reason DebugEventReason) error { + g, ok := dbg.getGoRoutine(id) + if !ok { + return ErrNotLive + } + + if g.running { + return ErrRunning + } + + g.setMode(reason) + g.resume <- struct{}{} + return nil +} + +// Interrupt issues a stepInto, stepOver, or stepOut request to a running Go +// routine. Interrupt returns ErrRunning if the Go routine is running. Interrupt +// returns ErrNotLive if there is no Go routine with the corresponding ID, or if +// it is not live. +func (dbg *Debugger) Interrupt(id int, reason DebugEventReason) bool { + g, ok := dbg.getGoRoutine(id) + if !ok { + return false + } + + g.setMode(reason) + return true +} + +// Terminate attempts to terminate the program. +func (dbg *Debugger) Terminate() { + dbg.gLock.Lock() + g := dbg.gLive + dbg.gLive = nil + dbg.gLock.Unlock() + + for _, g := range g { + g.mode = DebugTerminate + close(g.resume) + } +} + +// BreakpointTarget is the target of a request to set breakpoints. +type BreakpointTarget func(*Debugger, func(*node)) + +// PathBreakpointTarget is used to set breapoints on compiled code by path. This +// can be used to set breakpoints on code compiled with EvalPath, or source +// packages loaded by Yaegi. +func PathBreakpointTarget(path string) BreakpointTarget { + return func(dbg *Debugger, cb func(*node)) { + for _, r := range dbg.interp.roots { + f := dbg.interp.fset.File(r.pos) + if f != nil && f.Name() == path { + cb(r) + return + } + } + } +} + +// ProgramBreakpointTarget is used to set breakpoints on a Program. +func ProgramBreakpointTarget(prog *Program) BreakpointTarget { + return func(_ *Debugger, cb func(*node)) { + cb(prog.root) + } +} + +// AllBreakpointTarget is used to set breakpoints on all compiled code. Do not +// use with LineBreakpoint. +func AllBreakpointTarget() BreakpointTarget { + return func(dbg *Debugger, cb func(*node)) { + for _, r := range dbg.interp.roots { + cb(r) + } + } +} + +type breakpointSetup struct { + roots []*node + lines map[int]int + funcs map[string]int +} + +// BreakpointRequest is a request to set a breakpoint. +type BreakpointRequest func(*breakpointSetup, int) + +// LineBreakpoint requests a breakpoint on the given line. +func LineBreakpoint(line int) BreakpointRequest { + return func(b *breakpointSetup, i int) { + b.lines[line] = i + } +} + +// FunctionBreakpoint requests a breakpoint on the named function. +func FunctionBreakpoint(name string) BreakpointRequest { + return func(b *breakpointSetup, i int) { + b.funcs[name] = i + } +} + +// SetBreakpoints sets breakpoints for the given target. The returned array has +// an entry for every request, in order. If a given breakpoint request cannot be +// satisfied, the corresponding entry will be marked invalid. If the target +// cannot be found, all entries will be marked invalid. +func (dbg *Debugger) SetBreakpoints(target BreakpointTarget, requests ...BreakpointRequest) []Breakpoint { + // start with all breakpoints unverified + results := make([]Breakpoint, len(requests)) + + // prepare all the requests + setup := new(breakpointSetup) + target(dbg, func(root *node) { + setup.roots = append(setup.roots, root) + setup.lines = make(map[int]int, len(requests)) + setup.funcs = make(map[string]int, len(requests)) + for i, rq := range requests { + rq(setup, i) + } + }) + + // find breakpoints + for _, root := range setup.roots { + root.Walk(func(n *node) bool { + // function breakpoints + if len(setup.funcs) > 0 && n.kind == funcDecl { + // reset stale breakpoints + n.start.setBreakOnCall(false) + + if i, ok := setup.funcs[n.child[1].ident]; ok && !results[i].Valid { + results[i].Valid = true + results[i].Position = dbg.interp.fset.Position(n.start.pos) + n.start.setBreakOnCall(true) + return true + } + } + + // line breakpoints + if len(setup.lines) > 0 && n.pos.IsValid() && n.action != aNop && getExec(n) != nil { + // reset stale breakpoints + n.setBreakOnLine(false) + + pos := dbg.interp.fset.Position(n.pos) + if i, ok := setup.lines[pos.Line]; ok && !results[i].Valid { + results[i].Valid = true + results[i].Position = pos + n.setBreakOnLine(true) + return true + } + } + + return true + }, nil) + } + + return results +} + +// GoRoutines returns an array of live Go routines. +func (dbg *Debugger) GoRoutines() []*DebugGoRoutine { + dbg.gLock.Lock() + r := make([]*DebugGoRoutine, 0, len(dbg.gLive)) + for id := range dbg.gLive { + r = append(r, &DebugGoRoutine{id}) + } + dbg.gLock.Unlock() + sort.Slice(r, func(i, j int) bool { return r[i].id < r[j].id }) + return r +} + +// ID returns the ID of the Go routine. +func (r *DebugGoRoutine) ID() int { return r.id } + +// Name returns "Goroutine {ID}". +func (r *DebugGoRoutine) Name() string { return fmt.Sprintf("Goroutine %d", r.id) } + +// GoRoutine returns the ID of the Go routine that generated the event. +func (evt *DebugEvent) GoRoutine() int { + if evt.frame.debug == nil { + return 0 + } + return evt.frame.debug.g.id +} + +// Reason returns the reason for the event. +func (evt *DebugEvent) Reason() DebugEventReason { + return evt.reason +} + +// Walk the stack trace frames. The root frame is included if and only if it is +// the only frame. Closure frames are rolled up into the following call frame. +func (evt *DebugEvent) walkFrames(fn func([]*frame) bool) { + if evt.frame == evt.frame.root { + fn([]*frame{evt.frame}) + return + } + + var g *debugRoutine + if evt.frame.debug != nil { + g = evt.frame.debug.g + } + + var frames []*frame + for f := evt.frame; f != nil && f != f.root && (f.debug == nil || f.debug.g == g); f = f.anc { + if f.debug == nil || f.debug.kind != frameCall { + frames = append(frames, f) + continue + } + + if len(frames) > 0 { + if !fn(frames) { + return + } + } + + frames = frames[:0] + frames = append(frames, f) + } + + if len(frames) > 0 { + fn(frames) + } +} + +// FrameDepth returns the number of call frames in the stack trace. +func (evt *DebugEvent) FrameDepth() int { + if evt.frame == evt.frame.root { + return 1 + } + + var n int + evt.walkFrames(func([]*frame) bool { n++; return true }) + return n +} + +// Frames returns the call frames in the range [start, end). +func (evt *DebugEvent) Frames(start, end int) []*DebugFrame { + count := end - start + if count < 0 { + return nil + } + + frames := []*DebugFrame{} + evt.walkFrames(func(f []*frame) bool { + df := &DebugFrame{evt, make([]*frame, len(f))} + copy(df.frames, f) + frames = append(frames, df) + return len(frames) < count + }) + return frames +} + +// Name returns the name of the stack frame. For function calls to named +// functions, this is the function name. +func (f *DebugFrame) Name() string { + d := f.frames[0].debug + if d == nil { + return "" + } + switch d.kind { + case frameRoot: + return "" + case frameClosure: + return "" + case frameCall: + if d.name == "" { + return "" + } + return d.name + default: + return "" + } +} + +// Position returns the current position of the frame. This is effectively the +// program counter/link register. May return `Position{}`. +func (f *DebugFrame) Position() token.Position { + d := f.frames[0].debug + if d == nil || d.node == nil { + return token.Position{} + } + return f.event.debugger.interp.fset.Position(d.node.pos) +} + +// Program returns the program associated with the current position of the +// frame. May return nil. +func (f *DebugFrame) Program() *Program { + d := f.frames[0].debug + if d == nil || d.node == nil { + return nil + } + + return d.node.debug.program +} + +// Scopes returns the variable scopes of the frame. +func (f *DebugFrame) Scopes() []*DebugFrameScope { + s := make([]*DebugFrameScope, len(f.frames)) + for i, f := range f.frames { + s[i] = &DebugFrameScope{f} + } + return s +} + +// IsClosure returns true if this is the capture scope of a closure. +func (f *DebugFrameScope) IsClosure() bool { + return f.frame.debug != nil && f.frame.debug.kind == frameClosure +} + +// Variables returns the names and values of the variables of the scope. +func (f *DebugFrameScope) Variables() []*DebugVariable { + d := f.frame.debug + if d == nil || d.scope == nil { + return nil + } + + index := map[int]string{} + scanScope(d.scope, index) + + m := make([]*DebugVariable, 0, len(f.frame.data)) + for i, v := range f.frame.data { + if typ := v.Type(); typ.AssignableTo(rNodeType) || typ.Kind() == reflect.Ptr && typ.Elem().AssignableTo(rNodeType) { + continue + } + name, ok := index[i] + if !ok { + continue + } + + m = append(m, &DebugVariable{name, v}) + } + return m +} + +func scanScope(sc *scope, index map[int]string) { + for name, sym := range sc.sym { + if _, ok := index[sym.index]; ok { + continue + } + index[sym.index] = name + } + + for _, ch := range sc.child { + if ch.def != sc.def { + continue + } + scanScope(ch, index) + } +} diff --git a/vendor/github.com/traefik/yaegi/interp/doc.go b/vendor/github.com/traefik/yaegi/interp/doc.go index 2253eca..74c83d5 100644 --- a/vendor/github.com/traefik/yaegi/interp/doc.go +++ b/vendor/github.com/traefik/yaegi/interp/doc.go @@ -4,7 +4,7 @@ Package interp provides a complete Go interpreter. For the Go language itself, refer to the official Go specification https://golang.org/ref/spec. -Importing packages +# Importing packages Packages can be imported in source or binary form, using the standard Go import statement. In source form, packages are searched first in the @@ -16,7 +16,7 @@ Binary form packages are compiled and linked with the interpreter executable, and exposed to scripts with the Use method. The extract subcommand of yaegi can be used to generate package wrappers. -Custom build tags +# Custom build tags Custom build tags allow to control which files in imported source packages are interpreted, in the same way as the "-tags" option of the diff --git a/vendor/github.com/traefik/yaegi/interp/dot.go b/vendor/github.com/traefik/yaegi/interp/dot.go index 5222b04..d24f074 100644 --- a/vendor/github.com/traefik/yaegi/interp/dot.go +++ b/vendor/github.com/traefik/yaegi/interp/dot.go @@ -3,7 +3,6 @@ package interp import ( "fmt" "io" - "io/ioutil" "log" "os/exec" "path/filepath" @@ -69,7 +68,7 @@ func (nopCloser) Close() error { return nil } // dotWriter returns an output stream to a dot(1) co-process where to write data in .dot format. func dotWriter(dotCmd string) io.WriteCloser { if dotCmd == "" { - return nopCloser{ioutil.Discard} + return nopCloser{io.Discard} } fields := strings.Fields(dotCmd) cmd := exec.Command(fields[0], fields[1:]...) diff --git a/vendor/github.com/traefik/yaegi/interp/generic.go b/vendor/github.com/traefik/yaegi/interp/generic.go new file mode 100644 index 0000000..ec9ff3e --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/generic.go @@ -0,0 +1,281 @@ +package interp + +import ( + "strings" + "sync/atomic" +) + +// genAST returns a new AST where generic types are replaced by instantiated types. +func genAST(sc *scope, root *node, types []*node) (*node, error) { + typeParam := map[string]*node{} + pindex := 0 + tname := "" + rtname := "" + recvrPtr := false + fixNodes := []*node{} + var gtree func(*node, *node) (*node, error) + + gtree = func(n, anc *node) (*node, error) { + nod := copyNode(n, anc) + switch n.kind { + case funcDecl, funcType: + nod.val = nod + + case identExpr: + // Replace generic type by instantiated one. + nt, ok := typeParam[n.ident] + if !ok { + break + } + nod = copyNode(nt, anc) + + case indexExpr: + // Catch a possible recursive generic type definition + if root.kind != typeSpec { + break + } + if root.child[0].ident != n.child[0].ident { + break + } + nod := copyNode(n.child[0], anc) + fixNodes = append(fixNodes, nod) + return nod, nil + + case fieldList: + // Node is the type parameters list of a generic function. + if root.kind == funcDecl && n.anc == root.child[2] && childPos(n) == 0 { + // Fill the types lookup table used for type substitution. + for _, c := range n.child { + l := len(c.child) - 1 + for _, cc := range c.child[:l] { + if pindex >= len(types) { + return nil, cc.cfgErrorf("undefined type for %s", cc.ident) + } + if err := checkConstraint(sc, types[pindex], c.child[l]); err != nil { + return nil, err + } + typeParam[cc.ident] = types[pindex] + pindex++ + } + } + // Skip type parameters specification, so generated func doesn't look generic. + return nod, nil + } + + // Node is the receiver of a generic method. + if root.kind == funcDecl && n.anc == root && childPos(n) == 0 && len(n.child) > 0 { + rtn := n.child[0].child[1] + if rtn.kind == indexExpr || (rtn.kind == starExpr && rtn.child[0].kind == indexExpr) { + // Method receiver is a generic type. + if rtn.kind == starExpr && rtn.child[0].kind == indexExpr { + // Method receiver is a pointer on a generic type. + rtn = rtn.child[0] + recvrPtr = true + } + rtname = rtn.child[0].ident + "[" + for _, cc := range rtn.child[1:] { + if pindex >= len(types) { + return nil, cc.cfgErrorf("undefined type for %s", cc.ident) + } + it, err := nodeType(n.interp, sc, types[pindex]) + if err != nil { + return nil, err + } + typeParam[cc.ident] = types[pindex] + rtname += it.id() + "," + pindex++ + } + rtname = strings.TrimSuffix(rtname, ",") + "]" + } + } + + // Node is the type parameters list of a generic type. + if root.kind == typeSpec && n.anc == root && childPos(n) == 1 { + // Fill the types lookup table used for type substitution. + tname = n.anc.child[0].ident + "[" + for _, c := range n.child { + l := len(c.child) - 1 + for _, cc := range c.child[:l] { + if pindex >= len(types) { + return nil, cc.cfgErrorf("undefined type for %s", cc.ident) + } + it, err := nodeType(n.interp, sc, types[pindex]) + if err != nil { + return nil, err + } + if err := checkConstraint(sc, types[pindex], c.child[l]); err != nil { + return nil, err + } + typeParam[cc.ident] = types[pindex] + tname += it.id() + "," + pindex++ + } + } + tname = strings.TrimSuffix(tname, ",") + "]" + return nod, nil + } + } + for _, c := range n.child { + gn, err := gtree(c, nod) + if err != nil { + return nil, err + } + nod.child = append(nod.child, gn) + } + return nod, nil + } + + r, err := gtree(root, root.anc) + if err != nil { + return nil, err + } + if tname != "" { + for _, nod := range fixNodes { + nod.ident = tname + } + r.child[0].ident = tname + } + if rtname != "" { + // Replace method receiver type by synthetized ident. + nod := r.child[0].child[0].child[1] + if recvrPtr { + nod = nod.child[0] + } + nod.kind = identExpr + nod.ident = rtname + nod.child = nil + } + // r.astDot(dotWriter(root.interp.dotCmd), root.child[1].ident) // Used for debugging only. + return r, nil +} + +func copyNode(n, anc *node) *node { + var i interface{} + nindex := atomic.AddInt64(&n.interp.nindex, 1) + nod := &node{ + debug: n.debug, + anc: anc, + interp: n.interp, + index: nindex, + level: n.level, + nleft: n.nleft, + nright: n.nright, + kind: n.kind, + pos: n.pos, + action: n.action, + gen: n.gen, + val: &i, + rval: n.rval, + ident: n.ident, + meta: n.meta, + } + nod.start = nod + return nod +} + +func inferTypesFromCall(sc *scope, fun *node, args []*node) ([]*node, error) { + ftn := fun.typ.node + // Fill the map of parameter types, indexed by type param ident. + types := map[string]*itype{} + for _, c := range ftn.child[0].child { + typ, err := nodeType(fun.interp, sc, c.lastChild()) + if err != nil { + return nil, err + } + for _, cc := range c.child[:len(c.child)-1] { + types[cc.ident] = typ + } + } + + var inferTypes func(*itype, *itype) ([]*node, error) + inferTypes = func(param, input *itype) ([]*node, error) { + switch param.cat { + case chanT, ptrT, sliceT: + return inferTypes(param.val, input.val) + + case mapT: + k, err := inferTypes(param.key, input.key) + if err != nil { + return nil, err + } + v, err := inferTypes(param.val, input.val) + if err != nil { + return nil, err + } + return append(k, v...), nil + + case structT: + nods := []*node{} + for i, f := range param.field { + nl, err := inferTypes(f.typ, input.field[i].typ) + if err != nil { + return nil, err + } + nods = append(nods, nl...) + } + return nods, nil + + case funcT: + nods := []*node{} + for i, t := range param.arg { + nl, err := inferTypes(t, input.arg[i]) + if err != nil { + return nil, err + } + nods = append(nods, nl...) + } + for i, t := range param.ret { + nl, err := inferTypes(t, input.ret[i]) + if err != nil { + return nil, err + } + nods = append(nods, nl...) + } + return nods, nil + + case genericT: + return []*node{input.node}, nil + } + return nil, nil + } + + nodes := []*node{} + for i, c := range ftn.child[1].child { + typ, err := nodeType(fun.interp, sc, c.lastChild()) + if err != nil { + return nil, err + } + nods, err := inferTypes(typ, args[i].typ) + if err != nil { + return nil, err + } + nodes = append(nodes, nods...) + } + + return nodes, nil +} + +func checkConstraint(sc *scope, input, constraint *node) error { + ct, err := nodeType(constraint.interp, sc, constraint) + if err != nil { + return err + } + it, err := nodeType(input.interp, sc, input) + if err != nil { + return err + } + if len(ct.constraint) == 0 && len(ct.ulconstraint) == 0 { + return nil + } + for _, c := range ct.constraint { + if it.equals(c) { + return nil + } + } + for _, c := range ct.ulconstraint { + if it.underlying().equals(c) { + return nil + } + } + return input.cfgErrorf("%s does not implement %s", input.typ.id(), ct.id()) +} diff --git a/vendor/github.com/traefik/yaegi/interp/gta.go b/vendor/github.com/traefik/yaegi/interp/gta.go index c9ace35..d2cc617 100644 --- a/vendor/github.com/traefik/yaegi/interp/gta.go +++ b/vendor/github.com/traefik/yaegi/interp/gta.go @@ -1,8 +1,8 @@ package interp import ( + "path" "path/filepath" - "reflect" ) // gta performs a global types analysis on the AST, registering types, @@ -10,8 +10,8 @@ import ( // All function bodies are skipped. GTA is necessary to handle out of // order declarations and multiple source files packages. // rpath is the relative path to the directory containing the source for the package. -func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, error) { - sc := interp.initScopePkg(importPath) +func (interp *Interpreter) gta(root *node, rpath, importPath, pkgName string) ([]*node, error) { + sc := interp.initScopePkg(importPath, pkgName) var err error var revisit []*node @@ -25,7 +25,7 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e case constDecl: // Early parse of constDecl subtree, to compute all constant // values which may be used in further declarations. - if _, err = interp.cfg(n, importPath); err != nil { + if _, err = interp.cfg(n, sc, importPath, pkgName); err != nil { // No error processing here, to allow recovery in subtree nodes. // TODO(marc): check for a non recoverable error and return it for better diagnostic. err = nil @@ -37,10 +37,17 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e } case defineStmt: - var atyp *itype + var ( + atyp *itype + err2 error + ) if n.nleft+n.nright < len(n.child) { // Type is declared explicitly in the assign expression. - if atyp, err = nodeType(interp, sc, n.child[n.nleft]); err != nil { + if atyp, err2 = nodeType(interp, sc, n.child[n.nleft]); err2 != nil { + // The type does not exist yet, stash the error and come back + // when the type is known. + n.meta = err2 + revisit = append(revisit, n) return false } } @@ -52,9 +59,12 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e for i := 0; i < n.nleft; i++ { dest, src := n.child[i], n.child[sbase+i] - val := reflect.ValueOf(sc.iota) + if isBlank(src) { + err = n.cfgErrorf("cannot use _ as value") + } + val := src.rval if n.anc.kind == constDecl { - if _, err2 := interp.cfg(n, importPath); err2 != nil { + if _, err2 := interp.cfg(n, sc, importPath, pkgName); err2 != nil { // Constant value can not be computed yet. // Come back when child dependencies are known. revisit = append(revisit, n) @@ -63,7 +73,11 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e } typ := atyp if typ == nil { - if typ, err = nodeType(interp, sc, src); err != nil { + if typ, err2 = nodeType(interp, sc, src); err2 != nil || typ == nil { + // The type does is not known yet, stash the error and come back + // when the type is known. + n.meta = err2 + revisit = append(revisit, n) return false } val = src.rval @@ -78,11 +92,9 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e return false } if typ.isBinMethod { - typ = &itype{cat: valueT, rtype: typ.methodCallType(), isBinMethod: true, scope: sc} - } - if sc.sym[dest.ident] == nil || sc.sym[dest.ident].typ.incomplete { - sc.sym[dest.ident] = &symbol{kind: varSym, global: true, index: sc.add(typ), typ: typ, rval: val, node: n} + typ = valueTOf(typ.methodCallType(), isBinMethod(), withScope(sc)) } + sc.sym[dest.ident] = &symbol{kind: varSym, global: true, index: sc.add(typ), typ: typ, rval: val, node: n} if n.anc.kind == constDecl { sc.sym[dest.ident].kind = constSym if childPos(n) == len(n.anc.child)-1 { @@ -132,6 +144,7 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e if n.typ, err = nodeType(interp, sc, n.child[2]); err != nil { return false } + genericMethod := false ident := n.child[1].ident switch { case isMethod(n): @@ -140,28 +153,41 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e n.ident = ident rcvr := n.child[0].child[0] rtn := rcvr.lastChild() - typeName := rtn.ident - if typeName == "" { - // The receiver is a pointer, retrieve typeName from indirection - typeName = rtn.child[0].ident - elementType := sc.getType(typeName) - if elementType == nil { - // Add type if necessary, so method can be registered - sc.sym[typeName] = &symbol{kind: typeSym, typ: &itype{name: typeName, path: importPath, incomplete: true, node: rtn.child[0], scope: sc}} - elementType = sc.sym[typeName].typ - } - rcvrtype = &itype{cat: ptrT, val: elementType, incomplete: elementType.incomplete, node: rtn, scope: sc} - elementType.method = append(elementType.method, n) - } else { - rcvrtype = sc.getType(typeName) - if rcvrtype == nil { - // Add type if necessary, so method can be registered - sc.sym[typeName] = &symbol{kind: typeSym, typ: &itype{name: typeName, path: importPath, incomplete: true, node: rtn, scope: sc}} - rcvrtype = sc.sym[typeName].typ + typName, typPtr := rtn.ident, false + // Identifies the receiver type name. It could be an ident, a + // generic type (indexExpr), or a pointer on either lasts. + if typName == "" { + typName = rtn.child[0].ident + switch rtn.kind { + case starExpr: + typPtr = true + if rtn.child[0].kind == indexExpr { + typName = rtn.child[0].child[0].ident + genericMethod = true + } + case indexExpr: + genericMethod = true } } - rcvrtype.method = append(rcvrtype.method, n) - n.child[0].child[0].lastChild().typ = rcvrtype + sym, _, found := sc.lookup(typName) + if !found { + n.meta = n.cfgErrorf("undefined: %s", typName) + revisit = append(revisit, n) + return false + } + if sym.kind != typeSym || (sym.node != nil && sym.node.kind == typeSpecAssign) { + err = n.cfgErrorf("cannot define new methods on non-local type %s", baseType(sym.typ).id()) + return false + } + rcvrtype = sym.typ + if typPtr { + elementType := sym.typ + rcvrtype = ptrOf(elementType, withNode(rtn), withScope(sc)) + rcvrtype.incomplete = elementType.incomplete + elementType.addMethod(n) + } + rcvrtype.addMethod(n) + rtn.typ = rcvrtype case ident == "init": // init functions do not get declared as per the Go spec. default: @@ -172,9 +198,9 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e return false } // Add a function symbol in the package name space except for init - sc.sym[n.child[1].ident] = &symbol{kind: funcSym, typ: n.typ, node: n, index: -1} + sc.sym[ident] = &symbol{kind: funcSym, typ: n.typ, node: n, index: -1} } - if !n.typ.isComplete() { + if !n.typ.isComplete() && !genericMethod { revisit = append(revisit, n) } return false @@ -189,29 +215,43 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e } // Try to import a binary package first, or a source package var pkgName string - if interp.binPkg[ipath] != nil { + if packageName := path.Base(ipath); path.Dir(ipath) == packageName { + ipath = packageName + } + if pkg := interp.binPkg[ipath]; pkg != nil { switch name { case "_": // no import of symbols case ".": // import symbols in current scope - for n, v := range interp.binPkg[ipath] { + for n, v := range pkg { typ := v.Type() + kind := binSym if isBinType(v) { typ = typ.Elem() + kind = typeSym } - sc.sym[n] = &symbol{kind: binSym, typ: &itype{cat: valueT, rtype: typ, scope: sc}, rval: v} + sc.sym[n] = &symbol{kind: kind, typ: valueTOf(typ, withScope(sc)), rval: v} } default: // import symbols in package namespace if name == "" { - name = identifier.FindString(ipath) + name = interp.pkgNames[ipath] + } + + // If an incomplete type exists, delete it + if sym, exists := sc.sym[name]; exists && sym.kind == typeSym && sym.typ.incomplete { + delete(sc.sym, name) } - // imports of a same package are all mapped in the same scope, so we cannot just + + // Imports of a same package are all mapped in the same scope, so we cannot just // map them by their names, otherwise we could have collisions from same-name // imports in different source files of the same package. Therefore, we suffix // the key with the basename of the source file. name = filepath.Join(name, baseName) - if _, exists := sc.sym[name]; !exists { + if sym, exists := sc.sym[name]; !exists { sc.sym[name] = &symbol{kind: pkgSym, typ: &itype{cat: binPkgT, path: ipath, scope: sc}} break + } else if sym.kind == pkgSym && sym.typ.cat == srcPkgT && sym.typ.path == ipath { + // ignore re-import of identical package + break } // redeclaration error. Not caught by the parser. @@ -233,9 +273,12 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e name = pkgName } name = filepath.Join(name, baseName) - if _, exists := sc.sym[name]; !exists { + if sym, exists := sc.sym[name]; !exists { sc.sym[name] = &symbol{kind: pkgSym, typ: &itype{cat: srcPkgT, path: ipath, scope: sc}} break + } else if sym.kind == pkgSym && sym.typ.cat == srcPkgT && sym.typ.path == ipath { + // ignore re-import of identical package + break } // redeclaration error @@ -246,8 +289,21 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e err = n.cfgErrorf("import %q error: %v", ipath, err) } - case typeSpec: + case typeSpec, typeSpecAssign: + if isBlank(n.child[0]) { + err = n.cfgErrorf("cannot use _ as value") + return false + } typeName := n.child[0].ident + if len(n.child) > 2 { + // Handle a generic type: skip definition as parameter is not instantiated yet. + n.typ = genericOf(nil, typeName, withNode(n.child[0]), withScope(sc)) + if _, exists := sc.sym[typeName]; !exists { + sc.sym[typeName] = &symbol{kind: typeSym, node: n} + } + sc.sym[typeName].typ = n.typ + return false + } var typ *itype if typ, err = nodeType(interp, sc, n.child[1]); err != nil { err = nil @@ -257,13 +313,16 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e switch n.child[1].kind { case identExpr, selectorExpr: - n.typ = &itype{cat: aliasT, val: typ, name: typeName, path: importPath, field: typ.field, incomplete: typ.incomplete, scope: sc, node: n.child[0]} + n.typ = namedOf(typ, pkgName, typeName, withNode(n.child[0]), withScope(sc)) + n.typ.incomplete = typ.incomplete + n.typ.field = typ.field copy(n.typ.method, typ.method) default: n.typ = typ n.typ.name = typeName - n.typ.path = importPath + n.typ.path = pkgName } + n.typ.str = n.typ.path + "." + n.typ.name asImportName := filepath.Join(typeName, baseName) if _, exists := sc.sym[asImportName]; exists { @@ -273,15 +332,21 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e } sym, exists := sc.sym[typeName] if !exists { - sc.sym[typeName] = &symbol{kind: typeSym} + sc.sym[typeName] = &symbol{kind: typeSym, node: n} } else { if sym.typ != nil && (len(sym.typ.method) > 0) { + if n.kind == typeSpecAssign { + err = n.cfgErrorf("cannot define new methods on non-local type %s", baseType(typ).id()) + return false + } // Type has already been seen as a receiver in a method function - n.typ.method = append(n.typ.method, sym.typ.method...) + for _, m := range sym.typ.method { + n.typ.addMethod(m) + } } else { // TODO(mpl): figure out how to detect redeclarations without breaking type aliases. // Allow redeclarations for now. - sc.sym[typeName] = &symbol{kind: typeSym} + sc.sym[typeName] = &symbol{kind: typeSym, node: n} } } sc.sym[typeName].typ = n.typ @@ -299,12 +364,23 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e return revisit, err } +func baseType(t *itype) *itype { + for { + switch t.cat { + case ptrT, aliasT: + t = t.val + default: + return t + } + } +} + // gtaRetry (re)applies gta until all global constants and types are defined. -func (interp *Interpreter) gtaRetry(nodes []*node, importPath string) error { +func (interp *Interpreter) gtaRetry(nodes []*node, importPath, pkgName string) error { revisit := []*node{} for { for _, n := range nodes { - list, err := interp.gta(n, importPath, importPath) + list, err := interp.gta(n, importPath, importPath, pkgName) if err != nil { return err } @@ -321,10 +397,15 @@ func (interp *Interpreter) gtaRetry(nodes []*node, importPath string) error { if len(revisit) > 0 { n := revisit[0] - if n.kind == typeSpec { + switch n.kind { + case typeSpec, typeSpecAssign: if err := definedType(n.typ); err != nil { return err } + case defineStmt, funcDecl: + if err, ok := n.meta.(error); ok { + return err + } } return n.cfgErrorf("constant definition loop") } diff --git a/vendor/github.com/traefik/yaegi/interp/interp.go b/vendor/github.com/traefik/yaegi/interp/interp.go index 9d66943..3803d6f 100644 --- a/vendor/github.com/traefik/yaegi/interp/interp.go +++ b/vendor/github.com/traefik/yaegi/interp/interp.go @@ -4,16 +4,16 @@ import ( "bufio" "context" "errors" - "flag" "fmt" "go/build" "go/scanner" "go/token" "io" - "io/ioutil" - "log" + "io/fs" "os" "os/signal" + "path" + "path/filepath" "reflect" "runtime" "runtime/debug" @@ -25,6 +25,7 @@ import ( // Interpreter node structure for AST and CFG. type node struct { + debug *nodeDebugData // debug info child []*node // child subtrees (AST) anc *node // ancestor (AST) start *node // entry point in subtree (CFG) @@ -43,12 +44,53 @@ type node struct { typ *itype // type of value in frame, or nil recv *receiver // method receiver node for call, or nil types []reflect.Type // frame types, used by function literals only + scope *scope // frame scope action action // action exec bltn // generated function to execute gen bltnGenerator // generator function to produce above bltn val interface{} // static generic value (CFG execution) rval reflect.Value // reflection value to let runtime access interpreter (CFG) ident string // set if node is a var or func + meta interface{} // meta stores meta information between gta runs, like errors +} + +func (n *node) shouldBreak() bool { + if n == nil || n.debug == nil { + return false + } + + if n.debug.breakOnLine || n.debug.breakOnCall { + return true + } + + return false +} + +func (n *node) setProgram(p *Program) { + if n.debug == nil { + n.debug = new(nodeDebugData) + } + n.debug.program = p +} + +func (n *node) setBreakOnCall(v bool) { + if n.debug == nil { + if !v { + return + } + n.debug = new(nodeDebugData) + } + n.debug.breakOnCall = v +} + +func (n *node) setBreakOnLine(v bool) { + if n.debug == nil { + if !v { + return + } + n.debug = new(nodeDebugData) + } + n.debug.breakOnLine = v } // receiver stores method receiver object access path. @@ -65,6 +107,8 @@ type frame struct { // Located at start of struct to ensure proper aligment. id uint64 + debug *frameDebugData + root *frame // global space anc *frame // ancestor frame (caller space) data []reflect.Value // values @@ -102,6 +146,7 @@ func (f *frame) clone(fork bool) *frame { recovered: f.recovered, id: f.runid(), done: f.done, + debug: f.debug, } if fork { nf.data = make([]reflect.Value, len(f.data)) @@ -113,6 +158,8 @@ func (f *frame) clone(fork bool) *frame { } // Exports stores the map of binary packages per package path. +// The package path is the path joined from the import path and the package name +// as specified in source files by the "package" statement. type Exports map[string]map[string]reflect.Value // imports stores the map of source packages per package path. @@ -120,17 +167,22 @@ type imports map[string]map[string]*symbol // opt stores interpreter options. type opt struct { - astDot bool // display AST graph (debug) - cfgDot bool // display CFG graph (debug) // dotCmd is the command to process the dot graph produced when astDot and/or // cfgDot is enabled. It defaults to 'dot -Tdot -o .dot'. - dotCmd string - noRun bool // compile, but do not run - fastChan bool // disable cancellable chan operations - context build.Context // build context: GOPATH, build constraints - stdin io.Reader // standard input - stdout io.Writer // standard output - stderr io.Writer // standard error + dotCmd string + context build.Context // build context: GOPATH, build constraints + stdin io.Reader // standard input + stdout io.Writer // standard output + stderr io.Writer // standard error + args []string // cmdline args + env map[string]string // environment of interpreter, entries in form of "key=value" + filesystem fs.FS // filesystem containing sources + astDot bool // display AST graph (debug) + cfgDot bool // display CFG graph (debug) + noRun bool // compile, but do not run + fastChan bool // disable cancellable chan operations + specialStdio bool // allows os.Stdin, os.Stdout, os.Stderr to not be file descriptors + unrestricted bool // allow use of non sandboxed symbols } // Interpreter contains global resources and state. @@ -148,11 +200,12 @@ type Interpreter struct { name string // name of the input source file (or main) - opt // user settable options - cancelChan bool // enables cancellable chan operations - fset *token.FileSet // fileset to locate node in source code - binPkg Exports // binary packages used in interpreter, indexed by path - rdir map[string]bool // for src import cycle detection + opt // user settable options + cancelChan bool // enables cancellable chan operations + fset *token.FileSet // fileset to locate node in source code + binPkg Exports // binary packages used in interpreter, indexed by path + rdir map[string]bool // for src import cycle detection + mapTypes map[reflect.Value][]reflect.Type // special interfaces mapping for wrappers mutex sync.RWMutex frame *frame // program data storage during execution @@ -161,14 +214,17 @@ type Interpreter struct { srcPkg imports // source packages used in interpreter, indexed by path pkgNames map[string]string // package names, indexed by import path done chan struct{} // for cancellation of channel operations + roots []*node hooks *hooks // symbol hooks + + debugger *Debugger } const ( mainID = "main" selfPrefix = "github.com/traefik/yaegi" - selfPath = selfPrefix + "/interp" + selfPath = selfPrefix + "/interp/interp" // DefaultSourceName is the name used by default when the name of the input // source file has not been specified for an Eval. // TODO(mpl): something even more special as a name? @@ -180,6 +236,9 @@ const ( NoTest = true ) +// Self points to the current interpreter if accessed from within itself, or is nil. +var Self *Interpreter + // Symbols exposes interpreter values. var Symbols = Exports{ selfPath: map[string]reflect.Value{ @@ -195,6 +254,7 @@ func init() { Symbols[selfPath]["Symbols"] = reflect.ValueOf(Symbols) } // _error is a wrapper of error interface type. type _error struct { + IValue interface{} WError func() string } @@ -241,20 +301,36 @@ type Options struct { BuildTags []string // Standard input, output and error streams. - // They default to os.Stding, os.Stdout and os.Stderr respectively. + // They default to os.Stdin, os.Stdout and os.Stderr respectively. Stdin io.Reader Stdout, Stderr io.Writer + + // Cmdline args, defaults to os.Args. + Args []string + + // Environment of interpreter. Entries are in the form "key=values". + Env []string + + // SourcecodeFilesystem is where the _sourcecode_ is loaded from and does + // NOT affect the filesystem of scripts when they run. + // It can be any fs.FS compliant filesystem (e.g. embed.FS, or fstest.MapFS for testing) + // See example/fs/fs_test.go for an example. + SourcecodeFilesystem fs.FS + + // Unrestricted allows to run non sandboxed stdlib symbols such as os/exec and environment + Unrestricted bool } // New returns a new interpreter. func New(options Options) *Interpreter { i := Interpreter{ - opt: opt{context: build.Default}, + opt: opt{context: build.Default, filesystem: &realFS{}, env: map[string]string{}}, frame: newFrame(nil, 0, 0), fset: token.NewFileSet(), universe: initUniverse(), scopes: map[string]*scope{}, binPkg: Exports{"": map[string]reflect.Value{"_error": reflect.ValueOf((*_error)(nil))}}, + mapTypes: map[reflect.Value][]reflect.Type{}, srcPkg: imports{}, pkgNames: map[string]string{}, rdir: map[string]bool{}, @@ -273,6 +349,28 @@ func New(options Options) *Interpreter { i.opt.stderr = os.Stderr } + if i.opt.args = options.Args; i.opt.args == nil { + i.opt.args = os.Args + } + + // unrestricted allows to use non sandboxed stdlib symbols and env. + if options.Unrestricted { + i.opt.unrestricted = true + } else { + for _, e := range options.Env { + a := strings.SplitN(e, "=", 2) + if len(a) == 2 { + i.opt.env[a[0]] = a[1] + } else { + i.opt.env[a[0]] = "" + } + } + } + + if options.SourcecodeFilesystem != nil { + i.opt.filesystem = options.SourcecodeFilesystem + } + i.opt.context.GOPATH = options.GoPath if len(options.BuildTags) > 0 { i.opt.context.BuildTags = options.BuildTags @@ -294,6 +392,11 @@ func New(options Options) *Interpreter { // fastChan disables the cancellable version of channel operations in evalWithContext i.opt.fastChan, _ = strconv.ParseBool(os.Getenv("YAEGI_FAST_CHAN")) + + // specialStdio allows to assign directly io.Writer and io.Reader to os.Stdxxx, + // even if they are not file descriptors. + i.opt.specialStdio, _ = strconv.ParseBool(os.Getenv("YAEGI_SPECIAL_STDIO")) + return &i } @@ -318,35 +421,37 @@ const ( func initUniverse() *scope { sc := &scope{global: true, sym: map[string]*symbol{ // predefined Go types - "bool": {kind: typeSym, typ: &itype{cat: boolT, name: "bool"}}, - "byte": {kind: typeSym, typ: &itype{cat: uint8T, name: "uint8"}}, - "complex64": {kind: typeSym, typ: &itype{cat: complex64T, name: "complex64"}}, - "complex128": {kind: typeSym, typ: &itype{cat: complex128T, name: "complex128"}}, - "error": {kind: typeSym, typ: &itype{cat: errorT, name: "error"}}, - "float32": {kind: typeSym, typ: &itype{cat: float32T, name: "float32"}}, - "float64": {kind: typeSym, typ: &itype{cat: float64T, name: "float64"}}, - "int": {kind: typeSym, typ: &itype{cat: intT, name: "int"}}, - "int8": {kind: typeSym, typ: &itype{cat: int8T, name: "int8"}}, - "int16": {kind: typeSym, typ: &itype{cat: int16T, name: "int16"}}, - "int32": {kind: typeSym, typ: &itype{cat: int32T, name: "int32"}}, - "int64": {kind: typeSym, typ: &itype{cat: int64T, name: "int64"}}, - "interface{}": {kind: typeSym, typ: &itype{cat: interfaceT}}, - "rune": {kind: typeSym, typ: &itype{cat: int32T, name: "int32"}}, - "string": {kind: typeSym, typ: &itype{cat: stringT, name: "string"}}, - "uint": {kind: typeSym, typ: &itype{cat: uintT, name: "uint"}}, - "uint8": {kind: typeSym, typ: &itype{cat: uint8T, name: "uint8"}}, - "uint16": {kind: typeSym, typ: &itype{cat: uint16T, name: "uint16"}}, - "uint32": {kind: typeSym, typ: &itype{cat: uint32T, name: "uint32"}}, - "uint64": {kind: typeSym, typ: &itype{cat: uint64T, name: "uint64"}}, - "uintptr": {kind: typeSym, typ: &itype{cat: uintptrT, name: "uintptr"}}, + "any": {kind: typeSym, typ: &itype{cat: interfaceT, str: "any"}}, + "bool": {kind: typeSym, typ: &itype{cat: boolT, name: "bool", str: "bool"}}, + "byte": {kind: typeSym, typ: &itype{cat: uint8T, name: "uint8", str: "uint8"}}, + "comparable": {kind: typeSym, typ: &itype{cat: comparableT, name: "comparable", str: "comparable"}}, + "complex64": {kind: typeSym, typ: &itype{cat: complex64T, name: "complex64", str: "complex64"}}, + "complex128": {kind: typeSym, typ: &itype{cat: complex128T, name: "complex128", str: "complex128"}}, + "error": {kind: typeSym, typ: &itype{cat: errorT, name: "error", str: "error"}}, + "float32": {kind: typeSym, typ: &itype{cat: float32T, name: "float32", str: "float32"}}, + "float64": {kind: typeSym, typ: &itype{cat: float64T, name: "float64", str: "float64"}}, + "int": {kind: typeSym, typ: &itype{cat: intT, name: "int", str: "int"}}, + "int8": {kind: typeSym, typ: &itype{cat: int8T, name: "int8", str: "int8"}}, + "int16": {kind: typeSym, typ: &itype{cat: int16T, name: "int16", str: "int16"}}, + "int32": {kind: typeSym, typ: &itype{cat: int32T, name: "int32", str: "int32"}}, + "int64": {kind: typeSym, typ: &itype{cat: int64T, name: "int64", str: "int64"}}, + "interface{}": {kind: typeSym, typ: &itype{cat: interfaceT, str: "interface{}"}}, + "rune": {kind: typeSym, typ: &itype{cat: int32T, name: "int32", str: "int32"}}, + "string": {kind: typeSym, typ: &itype{cat: stringT, name: "string", str: "string"}}, + "uint": {kind: typeSym, typ: &itype{cat: uintT, name: "uint", str: "uint"}}, + "uint8": {kind: typeSym, typ: &itype{cat: uint8T, name: "uint8", str: "uint8"}}, + "uint16": {kind: typeSym, typ: &itype{cat: uint16T, name: "uint16", str: "uint16"}}, + "uint32": {kind: typeSym, typ: &itype{cat: uint32T, name: "uint32", str: "uint32"}}, + "uint64": {kind: typeSym, typ: &itype{cat: uint64T, name: "uint64", str: "uint64"}}, + "uintptr": {kind: typeSym, typ: &itype{cat: uintptrT, name: "uintptr", str: "uintptr"}}, // predefined Go constants - "false": {kind: constSym, typ: untypedBool(), rval: reflect.ValueOf(false)}, - "true": {kind: constSym, typ: untypedBool(), rval: reflect.ValueOf(true)}, - "iota": {kind: constSym, typ: untypedInt()}, + "false": {kind: constSym, typ: untypedBool(nil), rval: reflect.ValueOf(false)}, + "true": {kind: constSym, typ: untypedBool(nil), rval: reflect.ValueOf(true)}, + "iota": {kind: constSym, typ: untypedInt(nil)}, // predefined Go zero value - "nil": {typ: &itype{cat: nilT, untyped: true}}, + "nil": {typ: &itype{cat: nilT, untyped: true, str: "nil"}}, // predefined Go builtins bltnAppend: {kind: bltnSym, builtin: _append}, @@ -393,18 +498,42 @@ func (interp *Interpreter) Eval(src string) (res reflect.Value, err error) { // by the interpreter, and a non nil error in case of failure. // The main function of the main package is executed if present. func (interp *Interpreter) EvalPath(path string) (res reflect.Value, err error) { - if !isFile(path) { + if !isFile(interp.opt.filesystem, path) { _, err := interp.importSrc(mainID, path, NoTest) return res, err } - b, err := ioutil.ReadFile(path) + b, err := fs.ReadFile(interp.filesystem, path) if err != nil { return res, err } return interp.eval(string(b), path, false) } +// EvalPathWithContext evaluates Go code located at path and returns the last +// result computed by the interpreter, and a non nil error in case of failure. +// The main function of the main package is executed if present. +func (interp *Interpreter) EvalPathWithContext(ctx context.Context, path string) (res reflect.Value, err error) { + interp.mutex.Lock() + interp.done = make(chan struct{}) + interp.cancelChan = !interp.opt.fastChan + interp.mutex.Unlock() + + done := make(chan struct{}) + go func() { + defer close(done) + res, err = interp.EvalPath(path) + }() + + select { + case <-ctx.Done(): + interp.stop() + return reflect.Value{}, ctx.Err() + case <-done: + } + return res, err +} + // EvalTest evaluates Go code located at path, including test files with "_test.go" suffix. // A non nil error is returned in case of failure. // The main function, test functions and benchmark functions are internally compiled but not @@ -414,185 +543,22 @@ func (interp *Interpreter) EvalTest(path string) error { return err } -// Symbols returns a map of interpreter exported symbol values for the given -// import path. If the argument is the empty string, all known symbols are -// returned. -func (interp *Interpreter) Symbols(importPath string) Exports { - m := map[string]map[string]reflect.Value{} - interp.mutex.RLock() - defer interp.mutex.RUnlock() - - for k, v := range interp.srcPkg { - if importPath != "" && k != importPath { - continue - } - syms := map[string]reflect.Value{} - for n, s := range v { - if !canExport(n) { - // Skip private non-exported symbols. - continue - } - switch s.kind { - case constSym: - syms[n] = s.rval - case funcSym: - syms[n] = genFunctionWrapper(s.node)(interp.frame) - case varSym: - syms[n] = interp.frame.data[s.index] - case typeSym: - syms[n] = reflect.New(s.typ.TypeOf()) - } - } - - if len(syms) > 0 { - m[k] = syms - } - - if importPath != "" { - return m - } - } - - if importPath != "" && len(m) > 0 { - return m - } - - for k, v := range interp.binPkg { - if importPath != "" && k != importPath { - continue - } - m[k] = v - if importPath != "" { - return m - } - } - - return m -} - -func isFile(path string) bool { - fi, err := os.Stat(path) +func isFile(filesystem fs.FS, path string) bool { + fi, err := fs.Stat(filesystem, path) return err == nil && fi.Mode().IsRegular() } func (interp *Interpreter) eval(src, name string, inc bool) (res reflect.Value, err error) { - if name != "" { - interp.name = name - } - if interp.name == "" { - interp.name = DefaultSourceName - } - - defer func() { - r := recover() - if r != nil { - var pc [64]uintptr // 64 frames should be enough. - n := runtime.Callers(1, pc[:]) - err = Panic{Value: r, Callers: pc[:n], Stack: debug.Stack()} - } - }() - - // Parse source to AST. - pkgName, root, err := interp.ast(src, interp.name, inc) - if err != nil || root == nil { - return res, err - } - - if interp.astDot { - dotCmd := interp.dotCmd - if dotCmd == "" { - dotCmd = defaultDotCmd(interp.name, "yaegi-ast-") - } - root.astDot(dotWriter(dotCmd), interp.name) - if interp.noRun { - return res, err - } - } - - // Perform global types analysis. - if err = interp.gtaRetry([]*node{root}, pkgName); err != nil { - return res, err - } - - // Annotate AST with CFG informations. - initNodes, err := interp.cfg(root, pkgName) + prog, err := interp.compileSrc(src, name, inc) if err != nil { - if interp.cfgDot { - dotCmd := interp.dotCmd - if dotCmd == "" { - dotCmd = defaultDotCmd(interp.name, "yaegi-cfg-") - } - root.cfgDot(dotWriter(dotCmd)) - } return res, err } - if root.kind != fileStmt { - // REPL may skip package statement. - setExec(root.start) - } - interp.mutex.Lock() - gs := interp.scopes[pkgName] - if interp.universe.sym[pkgName] == nil { - // Make the package visible under a path identical to its name. - interp.srcPkg[pkgName] = gs.sym - interp.universe.sym[pkgName] = &symbol{kind: pkgSym, typ: &itype{cat: srcPkgT, path: pkgName}} - interp.pkgNames[pkgName] = pkgName - } - interp.mutex.Unlock() - - // Add main to list of functions to run, after all inits. - if m := gs.sym[mainID]; pkgName == mainID && m != nil { - initNodes = append(initNodes, m.node) - } - - if interp.cfgDot { - dotCmd := interp.dotCmd - if dotCmd == "" { - dotCmd = defaultDotCmd(interp.name, "yaegi-cfg-") - } - root.cfgDot(dotWriter(dotCmd)) - } - if interp.noRun { return res, err } - // Generate node exec closures. - if err = genRun(root); err != nil { - return res, err - } - - // Init interpreter execution memory frame. - interp.frame.setrunid(interp.runid()) - interp.frame.mutex.Lock() - interp.resizeFrame() - interp.frame.mutex.Unlock() - - // Execute node closures. - interp.run(root, nil) - - // Wire and execute global vars. - n, err := genGlobalVars([]*node{root}, interp.scopes[pkgName]) - if err != nil { - return res, err - } - interp.run(n, nil) - - for _, n := range initNodes { - interp.run(n, interp.frame) - } - v := genValue(root) - res = v(interp.frame) - - // If result is an interpreter node, wrap it in a runtime callable function. - if res.IsValid() { - if n, ok := res.Interface().(*node); ok { - res = genFunctionWrapper(n)(interp.frame) - } - } - - return res, err + return interp.Execute(prog) } // EvalWithContext evaluates Go code represented as a string. It returns @@ -608,7 +574,14 @@ func (interp *Interpreter) EvalWithContext(ctx context.Context, src string) (ref done := make(chan struct{}) go func() { - defer close(done) + defer func() { + if r := recover(); r != nil { + var pc [64]uintptr + n := runtime.Callers(1, pc[:]) + err = Panic{Value: r, Callers: pc[:n], Stack: debug.Stack()} + } + close(done) + }() v, err = interp.Eval(src) }() @@ -631,95 +604,6 @@ func (interp *Interpreter) stop() { func (interp *Interpreter) runid() uint64 { return atomic.LoadUint64(&interp.id) } -// getWrapper returns the wrapper type of the corresponding interface, or nil if not found. -func (interp *Interpreter) getWrapper(t reflect.Type) reflect.Type { - if p, ok := interp.binPkg[t.PkgPath()]; ok { - return p["_"+t.Name()].Type().Elem() - } - return nil -} - -// Use loads binary runtime symbols in the interpreter context so -// they can be used in interpreted code. -func (interp *Interpreter) Use(values Exports) { - for k, v := range values { - if k == selfPrefix { - interp.hooks.Parse(v) - continue - } - - if interp.binPkg[k] == nil { - interp.binPkg[k] = make(map[string]reflect.Value) - } - - for s, sym := range v { - interp.binPkg[k][s] = sym - } - } - - // Checks if input values correspond to stdlib packages by looking for one - // well known stdlib package path. - if _, ok := values["fmt"]; ok { - fixStdio(interp) - } -} - -// fixStdio redefines interpreter stdlib symbols to use the standard input, -// output and errror assigned to the interpreter. The changes are limited to -// the interpreter only. Global values os.Stdin, os.Stdout and os.Stderr are -// not changed. Note that it is possible to escape the virtualized stdio by -// read/write directly to file descriptors 0, 1, 2. -func fixStdio(interp *Interpreter) { - p := interp.binPkg["fmt"] - if p == nil { - return - } - - stdin, stdout, stderr := interp.stdin, interp.stdout, interp.stderr - - p["Print"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fprint(stdout, a...) }) - p["Printf"] = reflect.ValueOf(func(f string, a ...interface{}) (n int, err error) { return fmt.Fprintf(stdout, f, a...) }) - p["Println"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fprintln(stdout, a...) }) - - p["Scan"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fscan(stdin, a...) }) - p["Scanf"] = reflect.ValueOf(func(f string, a ...interface{}) (n int, err error) { return fmt.Fscanf(stdin, f, a...) }) - p["Scanln"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fscanln(stdin, a...) }) - - if p = interp.binPkg["flag"]; p != nil { - c := flag.NewFlagSet(os.Args[0], flag.PanicOnError) - c.SetOutput(stderr) - p["CommandLine"] = reflect.ValueOf(&c).Elem() - } - - if p = interp.binPkg["log"]; p != nil { - l := log.New(stderr, "", log.LstdFlags) - // Restrict Fatal symbols to panic instead of exit. - p["Fatal"] = reflect.ValueOf(l.Panic) - p["Fatalf"] = reflect.ValueOf(l.Panicf) - p["Fatalln"] = reflect.ValueOf(l.Panicln) - - p["Flags"] = reflect.ValueOf(l.Flags) - p["Output"] = reflect.ValueOf(l.Output) - p["Panic"] = reflect.ValueOf(l.Panic) - p["Panicf"] = reflect.ValueOf(l.Panicf) - p["Panicln"] = reflect.ValueOf(l.Panicln) - p["Prefix"] = reflect.ValueOf(l.Prefix) - p["Print"] = reflect.ValueOf(l.Print) - p["Printf"] = reflect.ValueOf(l.Printf) - p["Println"] = reflect.ValueOf(l.Println) - p["SetFlags"] = reflect.ValueOf(l.SetFlags) - p["SetOutput"] = reflect.ValueOf(l.SetOutput) - p["SetPrefix"] = reflect.ValueOf(l.SetPrefix) - p["Writer"] = reflect.ValueOf(l.Writer) - } - - if p = interp.binPkg["os"]; p != nil { - p["Stdin"] = reflect.ValueOf(&stdin).Elem() - p["Stdout"] = reflect.ValueOf(&stdout).Elem() - p["Stderr"] = reflect.ValueOf(&stderr).Elem() - } -} - // ignoreScannerError returns true if the error from Go scanner can be safely ignored // to let the caller grab one more line before retrying to parse its input. func ignoreScannerError(e *scanner.Error, s string) bool { @@ -736,24 +620,47 @@ func ignoreScannerError(e *scanner.Error, s string) bool { return false } -// REPL performs a Read-Eval-Print-Loop on input reader. -// Results are printed to the output writer of the Interpreter, provided as option -// at creation time. Errors are printed to the similarly defined errors writer. -// The last interpreter result value and error are returned. -func (interp *Interpreter) REPL() (reflect.Value, error) { - // Preimport used bin packages, to avoid having to import these packages manually - // in REPL mode. These packages are already loaded anyway. +// ImportUsed automatically imports pre-compiled packages included by Use(). +// This is mainly useful for REPLs, or single command lines. In case of an ambiguous default +// package name, for example "rand" for crypto/rand and math/rand, the package name is +// constructed by replacing the last "/" by a "_", producing crypto_rand and math_rand. +// ImportUsed should not be called more than once, and not after a first Eval, as it may +// rename packages. +func (interp *Interpreter) ImportUsed() { sc := interp.universe for k := range interp.binPkg { - name := identifier.FindString(k) - if name == "" || name == "rand" || name == "scanner" || name == "template" || name == "pprof" { - // Skip any package with an ambiguous name (i.e crypto/rand vs math/rand). - // Those will have to be imported explicitly. - continue + // By construction, the package name is the last path element of the key. + name := path.Base(k) + if sym, ok := sc.sym[name]; ok { + // Handle collision by renaming old and new entries. + name2 := key2name(fixKey(sym.typ.path)) + sc.sym[name2] = sym + if name2 != name { + delete(sc.sym, name) + } + name = key2name(fixKey(k)) } sc.sym[name] = &symbol{kind: pkgSym, typ: &itype{cat: binPkgT, path: k, scope: sc}} } +} + +func key2name(name string) string { + return filepath.Join(name, DefaultSourceName) +} + +func fixKey(k string) string { + i := strings.LastIndex(k, "/") + if i >= 0 { + k = k[:i] + "_" + k[i+1:] + } + return k +} +// REPL performs a Read-Eval-Print-Loop on input reader. +// Results are printed to the output writer of the Interpreter, provided as option +// at creation time. Errors are printed to the similarly defined errors writer. +// The last interpreter result value and error are returned. +func (interp *Interpreter) REPL() (reflect.Value, error) { in, out, errs := interp.stdin, interp.stdout, interp.stderr ctx, cancel := context.WithCancel(context.Background()) end := make(chan struct{}) // channel to terminate the REPL diff --git a/vendor/github.com/traefik/yaegi/interp/op.go b/vendor/github.com/traefik/yaegi/interp/op.go index 1672b64..424223a 100644 --- a/vendor/github.com/traefik/yaegi/interp/op.go +++ b/vendor/github.com/traefik/yaegi/interp/op.go @@ -1490,6 +1490,13 @@ func addAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1499,6 +1506,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v, s := v0(f) v.SetString(s + v1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: @@ -1507,6 +1517,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1515,6 +1528,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1523,6 +1539,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1531,6 +1550,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() + v1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1542,6 +1564,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v, s := v0(f) v.SetString(s + v1(f).String()) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: @@ -1551,6 +1576,9 @@ func addAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1560,6 +1588,9 @@ func addAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1569,6 +1600,9 @@ func addAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetFloat(i + j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1577,6 +1611,9 @@ func addAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() + v1(f).Complex()) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1587,6 +1624,13 @@ func andAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1596,6 +1640,9 @@ func andAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i & j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1604,6 +1651,9 @@ func andAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i & j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1616,6 +1666,9 @@ func andAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i & j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1625,6 +1678,9 @@ func andAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i & j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1635,6 +1691,13 @@ func andNotAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1644,6 +1707,9 @@ func andNotAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i &^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1652,6 +1718,9 @@ func andNotAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i &^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1664,6 +1733,9 @@ func andNotAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i &^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1673,6 +1745,9 @@ func andNotAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i &^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1683,6 +1758,13 @@ func mulAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1692,6 +1774,9 @@ func mulAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1700,6 +1785,9 @@ func mulAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1708,6 +1796,9 @@ func mulAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1716,6 +1807,9 @@ func mulAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() * v1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1728,6 +1822,9 @@ func mulAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1737,6 +1834,9 @@ func mulAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1746,6 +1846,9 @@ func mulAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetFloat(i * j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1754,6 +1857,9 @@ func mulAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() * v1(f).Complex()) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1764,6 +1870,13 @@ func orAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1773,6 +1886,9 @@ func orAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i | j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1781,6 +1897,9 @@ func orAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i | j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1793,6 +1912,9 @@ func orAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i | j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1802,6 +1924,9 @@ func orAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i | j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1812,6 +1937,13 @@ func quoAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1821,6 +1953,9 @@ func quoAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1829,6 +1964,9 @@ func quoAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1837,6 +1975,9 @@ func quoAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1845,6 +1986,9 @@ func quoAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() / v1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1857,6 +2001,9 @@ func quoAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1866,6 +2013,9 @@ func quoAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -1875,6 +2025,9 @@ func quoAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetFloat(i / j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -1883,6 +2036,9 @@ func quoAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() / v1(f).Complex()) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1893,6 +2049,13 @@ func remAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1902,6 +2065,9 @@ func remAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i % j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1910,6 +2076,9 @@ func remAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i % j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1922,6 +2091,9 @@ func remAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i % j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1931,6 +2103,9 @@ func remAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i % j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1941,6 +2116,13 @@ func shlAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1950,6 +2132,9 @@ func shlAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i << j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1958,6 +2143,9 @@ func shlAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i << j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1970,6 +2158,9 @@ func shlAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i << j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -1979,6 +2170,9 @@ func shlAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i << j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -1989,6 +2183,13 @@ func shrAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -1998,6 +2199,9 @@ func shrAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i >> j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2006,6 +2210,9 @@ func shrAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i >> j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2018,6 +2225,9 @@ func shrAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i >> j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2027,6 +2237,9 @@ func shrAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i >> j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2037,6 +2250,13 @@ func subAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -2046,6 +2266,9 @@ func subAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2054,6 +2277,9 @@ func subAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -2062,6 +2288,9 @@ func subAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -2070,6 +2299,9 @@ func subAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() - v1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2082,6 +2314,9 @@ func subAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2091,6 +2326,9 @@ func subAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: @@ -2100,6 +2338,9 @@ func subAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetFloat(i - j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: @@ -2108,6 +2349,9 @@ func subAssign(n *node) { n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() - v1(f).Complex()) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2118,6 +2362,13 @@ func xorAssign(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() c0, c1 := n.child[0], n.child[1] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } if c1.rval.IsValid() { switch typ.Kind() { @@ -2127,6 +2378,9 @@ func xorAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i ^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2135,6 +2389,9 @@ func xorAssign(n *node) { n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i ^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2147,6 +2404,9 @@ func xorAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetInt(i ^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -2156,6 +2416,9 @@ func xorAssign(n *node) { v, i := v0(f) _, j := v1(f) v.SetUint(i ^ j) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2165,34 +2428,54 @@ func xorAssign(n *node) { func dec(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() + c0 := n.child[0] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } switch typ.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - v0 := genValueInt(n.child[0]) + v0 := genValueInt(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i - 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - v0 := genValueUint(n.child[0]) + v0 := genValueUint(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i - 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: - v0 := genValueFloat(n.child[0]) + v0 := genValueFloat(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i - 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: - v0 := genValue(n.child[0]) + v0 := genValue(c0) n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() - 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2201,34 +2484,54 @@ func dec(n *node) { func inc(n *node) { next := getExec(n.tnext) typ := n.typ.TypeOf() + c0 := n.child[0] + setMap := isMapEntry(c0) + var mapValue, indexValue func(*frame) reflect.Value + + if setMap { + mapValue = genValue(c0.child[0]) + indexValue = genValue(c0.child[1]) + } switch typ.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - v0 := genValueInt(n.child[0]) + v0 := genValueInt(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetInt(i + 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - v0 := genValueUint(n.child[0]) + v0 := genValueUint(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetUint(i + 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Float32, reflect.Float64: - v0 := genValueFloat(n.child[0]) + v0 := genValueFloat(c0) n.exec = func(f *frame) bltn { v, i := v0(f) v.SetFloat(i + 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } case reflect.Complex64, reflect.Complex128: - v0 := genValue(n.child[0]) + v0 := genValue(c0) n.exec = func(f *frame) bltn { v := v0(f) v.SetComplex(v.Complex() + 1) + if setMap { + mapValue(f).SetMapIndex(indexValue(f), v) + } return next } } @@ -2321,6 +2624,7 @@ func equal(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() if c0.typ.cat == aliasT || c1.typ.cat == aliasT { switch { @@ -2341,7 +2645,7 @@ func equal(n *node) { fnext := getExec(n.fnext) n.exec = func(f *frame) bltn { i1 := v1(f).Interface() - if i0 != i1 { + if i0 == i1 { dest(f).SetBool(true) return tnext } @@ -2363,7 +2667,7 @@ func equal(n *node) { fnext := getExec(n.fnext) n.exec = func(f *frame) bltn { i0 := v0(f).Interface() - if i0 != i1 { + if i0 == i1 { dest(f).SetBool(true) return tnext } @@ -2386,7 +2690,7 @@ func equal(n *node) { n.exec = func(f *frame) bltn { i0 := v0(f).Interface() i1 := v1(f).Interface() - if i0 != i1 { + if i0 == i1 { dest(f).SetBool(true) return tnext } @@ -2406,7 +2710,37 @@ func equal(n *node) { return } - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + // Do not attempt to optimize '==' or '!=' if an operand is an interface. + // This will preserve proper dynamic type checking at runtime. For static types, + // type checks are already performed, so bypass them if possible. + if t0.Kind() == reflect.Interface || t1.Kind() == reflect.Interface { + v0 := genValue(c0) + v1 := genValue(c1) + if n.fnext != nil { + fnext := getExec(n.fnext) + n.exec = func(f *frame) bltn { + i0 := v0(f).Interface() + i1 := v1(f).Interface() + if i0 == i1 { + dest(f).SetBool(true) + return tnext + } + dest(f).SetBool(false) + return fnext + } + } else { + dest := genValue(n) + n.exec = func(f *frame) bltn { + i0 := v0(f).Interface() + i1 := v1(f).Interface() + dest(f).SetBool(i0 == i1) + return tnext + } + } + return + } + + switch { case isString(t0) || isString(t1): switch { case isInterface: @@ -2890,8 +3224,9 @@ func greater(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + switch { case isString(t0) || isString(t1): switch { case isInterface: @@ -3217,8 +3552,9 @@ func greaterEqual(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + switch { case isString(t0) || isString(t1): switch { case isInterface: @@ -3544,8 +3880,9 @@ func lower(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + switch { case isString(t0) || isString(t1): switch { case isInterface: @@ -3871,8 +4208,9 @@ func lowerEqual(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + switch { case isString(t0) || isString(t1): switch { case isInterface: @@ -4198,6 +4536,7 @@ func notEqual(n *node) { typ := n.typ.concrete().TypeOf() isInterface := n.typ.TypeOf().Kind() == reflect.Interface c0, c1 := n.child[0], n.child[1] + t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() if c0.typ.cat == aliasT || c1.typ.cat == aliasT { switch { @@ -4283,7 +4622,37 @@ func notEqual(n *node) { return } - switch t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf(); { + // Do not attempt to optimize '==' or '!=' if an operand is an interface. + // This will preserve proper dynamic type checking at runtime. For static types, + // type checks are already performed, so bypass them if possible. + if t0.Kind() == reflect.Interface || t1.Kind() == reflect.Interface { + v0 := genValue(c0) + v1 := genValue(c1) + if n.fnext != nil { + fnext := getExec(n.fnext) + n.exec = func(f *frame) bltn { + i0 := v0(f).Interface() + i1 := v1(f).Interface() + if i0 != i1 { + dest(f).SetBool(true) + return tnext + } + dest(f).SetBool(false) + return fnext + } + } else { + dest := genValue(n) + n.exec = func(f *frame) bltn { + i0 := v0(f).Interface() + i1 := v1(f).Interface() + dest(f).SetBool(i0 != i1) + return tnext + } + } + return + } + + switch { case isString(t0) || isString(t1): switch { case isInterface: diff --git a/vendor/github.com/traefik/yaegi/interp/program.go b/vendor/github.com/traefik/yaegi/interp/program.go new file mode 100644 index 0000000..28babbf --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/program.go @@ -0,0 +1,202 @@ +package interp + +import ( + "context" + "go/ast" + "go/token" + "os" + "reflect" + "runtime" + "runtime/debug" +) + +// A Program is Go code that has been parsed and compiled. +type Program struct { + pkgName string + root *node + init []*node +} + +// FileSet is the fileset that must be used for parsing Go that will be passed +// to interp.CompileAST(). +func (interp *Interpreter) FileSet() *token.FileSet { + return interp.fset +} + +// Compile parses and compiles a Go code represented as a string. +func (interp *Interpreter) Compile(src string) (*Program, error) { + return interp.compileSrc(src, "", true) +} + +// CompilePath parses and compiles a Go code located at the given path. +func (interp *Interpreter) CompilePath(path string) (*Program, error) { + if !isFile(interp.filesystem, path) { + _, err := interp.importSrc(mainID, path, NoTest) + return nil, err + } + + b, err := os.ReadFile(path) + if err != nil { + return nil, err + } + return interp.compileSrc(string(b), path, false) +} + +func (interp *Interpreter) compileSrc(src, name string, inc bool) (*Program, error) { + if name != "" { + interp.name = name + } + if interp.name == "" { + interp.name = DefaultSourceName + } + + // Parse source to AST. + n, err := interp.parse(src, interp.name, inc) + if err != nil { + return nil, err + } + + return interp.CompileAST(n) +} + +// CompileAST builds a Program for the given Go code AST. Files and block +// statements can be compiled, as can most expressions. Var declaration nodes +// cannot be compiled. +// +// WARNING: The node must have been parsed using interp.FileSet(). Results are +// unpredictable otherwise. +func (interp *Interpreter) CompileAST(n ast.Node) (*Program, error) { + // Convert AST. + pkgName, root, err := interp.ast(n) + if err != nil || root == nil { + return nil, err + } + + if interp.astDot { + dotCmd := interp.dotCmd + if dotCmd == "" { + dotCmd = defaultDotCmd(interp.name, "yaegi-ast-") + } + root.astDot(dotWriter(dotCmd), interp.name) + if interp.noRun { + return nil, err + } + } + + // Perform global types analysis. + if err = interp.gtaRetry([]*node{root}, pkgName, pkgName); err != nil { + return nil, err + } + + // Annotate AST with CFG informations. + initNodes, err := interp.cfg(root, nil, pkgName, pkgName) + if err != nil { + if interp.cfgDot { + dotCmd := interp.dotCmd + if dotCmd == "" { + dotCmd = defaultDotCmd(interp.name, "yaegi-cfg-") + } + root.cfgDot(dotWriter(dotCmd)) + } + return nil, err + } + + if root.kind != fileStmt { + // REPL may skip package statement. + setExec(root.start) + } + interp.mutex.Lock() + gs := interp.scopes[pkgName] + if interp.universe.sym[pkgName] == nil { + // Make the package visible under a path identical to its name. + interp.srcPkg[pkgName] = gs.sym + interp.universe.sym[pkgName] = &symbol{kind: pkgSym, typ: &itype{cat: srcPkgT, path: pkgName}} + interp.pkgNames[pkgName] = pkgName + } + interp.mutex.Unlock() + + // Add main to list of functions to run, after all inits. + if m := gs.sym[mainID]; pkgName == mainID && m != nil { + initNodes = append(initNodes, m.node) + } + + if interp.cfgDot { + dotCmd := interp.dotCmd + if dotCmd == "" { + dotCmd = defaultDotCmd(interp.name, "yaegi-cfg-") + } + root.cfgDot(dotWriter(dotCmd)) + } + + return &Program{pkgName, root, initNodes}, nil +} + +// Execute executes compiled Go code. +func (interp *Interpreter) Execute(p *Program) (res reflect.Value, err error) { + defer func() { + r := recover() + if r != nil { + var pc [64]uintptr // 64 frames should be enough. + n := runtime.Callers(1, pc[:]) + err = Panic{Value: r, Callers: pc[:n], Stack: debug.Stack()} + } + }() + + // Generate node exec closures. + if err = genRun(p.root); err != nil { + return res, err + } + + // Init interpreter execution memory frame. + interp.frame.setrunid(interp.runid()) + interp.frame.mutex.Lock() + interp.resizeFrame() + interp.frame.mutex.Unlock() + + // Execute node closures. + interp.run(p.root, nil) + + // Wire and execute global vars. + n, err := genGlobalVars([]*node{p.root}, interp.scopes[p.pkgName]) + if err != nil { + return res, err + } + interp.run(n, nil) + + for _, n := range p.init { + interp.run(n, interp.frame) + } + v := genValue(p.root) + res = v(interp.frame) + + // If result is an interpreter node, wrap it in a runtime callable function. + if res.IsValid() { + if n, ok := res.Interface().(*node); ok { + res = genFunctionWrapper(n)(interp.frame) + } + } + + return res, err +} + +// ExecuteWithContext executes compiled Go code. +func (interp *Interpreter) ExecuteWithContext(ctx context.Context, p *Program) (res reflect.Value, err error) { + interp.mutex.Lock() + interp.done = make(chan struct{}) + interp.cancelChan = !interp.opt.fastChan + interp.mutex.Unlock() + + done := make(chan struct{}) + go func() { + defer close(done) + res, err = interp.Execute(p) + }() + + select { + case <-ctx.Done(): + interp.stop() + return reflect.Value{}, ctx.Err() + case <-done: + } + return res, err +} diff --git a/vendor/github.com/traefik/yaegi/interp/realfs.go b/vendor/github.com/traefik/yaegi/interp/realfs.go new file mode 100644 index 0000000..9f680ab --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/realfs.go @@ -0,0 +1,21 @@ +package interp + +import ( + "io/fs" + "os" +) + +// realFS complies with the fs.FS interface (go 1.16 onwards) +// We use this rather than os.DirFS as DirFS has no concept of +// what the current working directory is, whereas this simple +// passthru to os.Open knows about working dir automagically. +type realFS struct{} + +// Open complies with the fs.FS interface. +func (dir realFS) Open(name string) (fs.File, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + return f, nil +} diff --git a/vendor/github.com/traefik/yaegi/interp/run.go b/vendor/github.com/traefik/yaegi/interp/run.go index 0c006ba..7660d1d 100644 --- a/vendor/github.com/traefik/yaegi/interp/run.go +++ b/vendor/github.com/traefik/yaegi/interp/run.go @@ -6,12 +6,9 @@ import ( "errors" "fmt" "go/constant" - "log" "reflect" "regexp" "strings" - "sync" - "unsafe" ) // bltn type defines functions which run at CFG execution. @@ -119,7 +116,17 @@ func (interp *Interpreter) run(n *node, cf *frame) { for i, t := range n.types { f.data[i] = reflect.New(t).Elem() } - runCfg(n.start, f) + runCfg(n.start, f, n, nil) +} + +func isExecNode(n *node, exec bltn) bool { + if n == nil || n.exec == nil || exec == nil { + return false + } + + a1 := reflect.ValueOf(n.exec).Pointer() + a2 := reflect.ValueOf(exec).Pointer() + return a1 == a2 } // originalExecNode looks in the tree of nodes for the node which has exec, @@ -167,7 +174,7 @@ func originalExecNode(n *node, exec bltn) *node { // Functions set to run during execution of CFG. // runCfg executes a node AST by walking its CFG and running node builtin at each step. -func runCfg(n *node, f *frame) { +func runCfg(n *node, f *frame, funcNode, callNode *node) { var exec bltn defer func() { f.mutex.Lock() @@ -187,8 +194,44 @@ func runCfg(n *node, f *frame) { f.mutex.Unlock() }() - for exec = n.exec; exec != nil && f.runid() == n.interp.runid(); { + dbg := n.interp.debugger + if dbg == nil { + for exec := n.exec; exec != nil && f.runid() == n.interp.runid(); { + exec = exec(f) + } + return + } + + if n.exec == nil { + return + } + + dbg.enterCall(funcNode, callNode, f) + defer dbg.exitCall(funcNode, callNode, f) + + for m, exec := n, n.exec; f.runid() == n.interp.runid(); { + if dbg.exec(m, f) { + break + } + exec = exec(f) + if exec == nil { + break + } + + if m == nil { + m = originalExecNode(n, exec) + continue + } + + switch { + case isExecNode(m.tnext, exec): + m = m.tnext + case isExecNode(m.fnext, exec): + m = m.fnext + default: + m = originalExecNode(m, exec) + } } } @@ -253,6 +296,9 @@ func typeAssert(n *node, withResult, withOk bool) { } return next } + if c0.typ.cat == valueT { + valf = reflect.ValueOf(v) + } if v.node.typ.id() == typID { if withResult { value0(f).Set(valf) @@ -372,8 +418,7 @@ func typeAssert(n *node, withResult, withOk bool) { } return next } - // empty interface - case n.child[0].typ.cat == interfaceT && len(n.child[0].typ.field) == 0: + case isEmptyInterface(n.child[0].typ): n.exec = func(f *frame) bltn { var ok bool if setStatus { @@ -422,6 +467,10 @@ func typeAssert(n *node, withResult, withOk bool) { return next } v = valueInterfaceValue(v) + if vt := v.Type(); vt.Kind() == reflect.Struct && vt.Field(0).Name == "IValue" { + // Value is retrieved from an interface wrapper. + v = v.Field(0).Elem() + } ok = canAssertTypes(v.Type(), rtype) if !ok { if !withOk { @@ -503,8 +552,8 @@ func convert(n *node) { if c.isNil() { // convert nil to type // TODO(mpl): Try to completely remove, as maybe frameType already does the job for interfaces. - if n.child[0].typ.cat == interfaceT && len(n.child[0].typ.field) > 0 { - typ = reflect.TypeOf((*valueInterface)(nil)).Elem() + if isInterfaceSrc(n.child[0].typ) && !isEmptyInterface(n.child[0].typ) { + typ = valueInterfaceType } n.exec = func(f *frame) bltn { dest(f).Set(reflect.New(typ).Elem()) @@ -513,7 +562,7 @@ func convert(n *node) { return } - if n.child[0].typ.cat == funcT && c.typ.cat == funcT { + if isFuncSrc(n.child[0].typ) && isFuncSrc(c.typ) { value := genValue(c) n.exec = func(f *frame) bltn { n, ok := value(f).Interface().(*node) @@ -531,9 +580,9 @@ func convert(n *node) { doConvert := true var value func(*frame) reflect.Value switch { - case c.typ.cat == funcT: + case isFuncSrc(c.typ): value = genFunctionWrapper(c) - case n.child[0].typ.cat == funcT && c.typ.cat == valueT: + case isFuncSrc(n.child[0].typ) && c.typ.cat == valueT: doConvert = false value = genValueNode(c) default: @@ -566,15 +615,31 @@ func convert(n *node) { } } -func isRecursiveType(t *itype, rtype reflect.Type) bool { - if t.cat == structT && rtype.Kind() == reflect.Interface { - return true +// assignFromCall assigns values from a function call. +func assignFromCall(n *node) { + ncall := n.lastChild() + l := len(n.child) - 1 + if n.anc.kind == varDecl && n.child[l-1].isType(n.scope) { + // Ignore the type in the assignment if it is part of a variable declaration. + l-- } - switch t.cat { - case ptrT, arrayT, mapT: - return isRecursiveType(t.val, t.val.rtype) - default: - return false + dvalue := make([]func(*frame) reflect.Value, l) + for i := range dvalue { + if n.child[i].ident == "_" { + continue + } + dvalue[i] = genValue(n.child[i]) + } + next := getExec(n.tnext) + n.exec = func(f *frame) bltn { + for i, v := range dvalue { + if v == nil { + continue + } + s := f.data[ncall.findex+i] + v(f).Set(s) + } + return next } } @@ -590,37 +655,13 @@ func assign(n *node) { for i := 0; i < n.nleft; i++ { dest, src := n.child[i], n.child[sbase+i] - switch { - case dest.typ.cat == interfaceT: - if len(dest.typ.field) > 0 { - svalue[i] = genValueInterface(src) - break - } - svalue[i] = genValue(src) - case (dest.typ.cat == valueT || dest.typ.cat == errorT) && dest.typ.rtype.Kind() == reflect.Interface: - svalue[i] = genInterfaceWrapper(src, dest.typ.rtype) - case src.typ.cat == funcT && dest.typ.cat == valueT: - svalue[i] = genFunctionWrapper(src) - case src.typ.cat == funcT && isField(dest): + if isFuncSrc(src.typ) && isField(dest) { svalue[i] = genFunctionWrapper(src) - case dest.typ.cat == funcT && src.typ.cat == valueT: - svalue[i] = genValueNode(src) - case src.kind == basicLit && src.val == nil: - t := dest.typ.TypeOf() - svalue[i] = func(*frame) reflect.Value { return reflect.New(t).Elem() } - case isRecursiveType(dest.typ, dest.typ.rtype): - svalue[i] = genValueRecursiveInterface(src, dest.typ.rtype) - case isRecursiveType(src.typ, src.typ.rtype): - svalue[i] = genValueRecursiveInterfacePtrValue(src) - case src.typ.untyped && isComplex(dest.typ.TypeOf()): - svalue[i] = genValueComplex(src) - case src.typ.untyped && !dest.typ.untyped: - svalue[i] = genValueAs(src, dest.typ.TypeOf()) - default: - svalue[i] = genValue(src) + } else { + svalue[i] = genDestValue(dest.typ, src) } if isMapEntry(dest) { - if dest.child[1].typ.cat == interfaceT { // key + if isInterfaceSrc(dest.child[1].typ) { // key ivalue[i] = genValueInterface(dest.child[1]) } else { ivalue[i] = genValue(dest.child[1]) @@ -668,11 +709,11 @@ func assign(n *node) { for i := range types { var t reflect.Type - switch typ := n.child[sbase+i].typ; typ.cat { - case funcT: + switch typ := n.child[sbase+i].typ; { + case isFuncSrc(typ): t = reflect.TypeOf((*node)(nil)) - case interfaceT: - t = reflect.TypeOf((*valueInterface)(nil)).Elem() + case isInterfaceSrc(typ): + t = valueInterfaceType default: t = typ.TypeOf() } @@ -752,19 +793,20 @@ func addr(n *node) { next := getExec(n.tnext) c0 := n.child[0] value := genValue(c0) - switch c0.typ.cat { - case interfaceT, ptrT: + + if isInterfaceSrc(c0.typ) || isPtrSrc(c0.typ) { i := n.findex l := n.level n.exec = func(f *frame) bltn { getFrame(f, l).data[i] = value(f).Addr() return next } - default: - n.exec = func(f *frame) bltn { - dest(f).Set(value(f).Addr()) - return next - } + return + } + + n.exec = func(f *frame) bltn { + dest(f).Set(value(f).Addr()) + return next } } @@ -838,14 +880,14 @@ func _recover(n *node) { n.exec = func(f *frame) bltn { if f.anc.recovered == nil { // TODO(mpl): maybe we don't need that special case, and we're just forgetting to unwrap the valueInterface somewhere else. - if n.typ.cat == interfaceT && len(n.typ.field) == 0 { + if isEmptyInterface(n.typ) { return tnext } dest(f).Set(reflect.ValueOf(valueInterface{})) return tnext } - if n.typ.cat == interfaceT && len(n.typ.field) == 0 { + if isEmptyInterface(n.typ) { dest(f).Set(reflect.ValueOf(f.anc.recovered)) } else { dest(f).Set(reflect.ValueOf(valueInterface{n, reflect.ValueOf(f.anc.recovered)})) @@ -937,33 +979,39 @@ func genFunctionWrapper(n *node) func(*frame) reflect.Value { d[i] = reflect.New(t).Elem() } - // Copy method receiver as first argument, if defined. - if rcvr != nil { + if rcvr == nil { + d = d[numRet:] + } else { + // Copy method receiver as first argument. src, dest := rcvr(f), d[numRet] - if src.Type().Kind() != dest.Type().Kind() { + sk, dk := src.Kind(), dest.Kind() + switch { + case sk == reflect.Ptr && dk != reflect.Ptr: + dest.Set(src.Elem()) + case sk != reflect.Ptr && dk == reflect.Ptr: dest.Set(src.Addr()) - } else { + default: if wrappedSrc, ok := src.Interface().(valueInterface); ok { src = wrappedSrc.value } dest.Set(src) } d = d[numRet+1:] - } else { - d = d[numRet:] } // Copy function input arguments in local frame. for i, arg := range in { + if i >= len(d) { + // In case of unused arg, there may be not even a frame entry allocated, just skip. + break + } typ := def.typ.arg[i] switch { - case typ.cat == interfaceT: - if len(typ.field) > 0 { - d[i].Set(reflect.ValueOf(valueInterface{value: arg.Elem()})) - break - } + case isEmptyInterface(typ) || typ.TypeOf() == valueInterfaceType: d[i].Set(arg) - case typ.cat == funcT && arg.Kind() == reflect.Func: + case isInterfaceSrc(typ): + d[i].Set(reflect.ValueOf(valueInterface{value: arg.Elem()})) + case isFuncSrc(typ) && arg.Kind() == reflect.Func: d[i].Set(reflect.ValueOf(genFunctionNode(arg))) default: d[i].Set(arg) @@ -971,7 +1019,7 @@ func genFunctionWrapper(n *node) func(*frame) reflect.Value { } // Interpreter code execution. - runCfg(start, fr) + runCfg(start, fr, def, n) result := fr.data[:numRet] for i, r := range result { @@ -985,7 +1033,7 @@ func genFunctionWrapper(n *node) func(*frame) reflect.Value { } func genFunctionNode(v reflect.Value) *node { - return &node{kind: funcType, action: aNop, rval: v, typ: &itype{cat: valueT, rtype: v.Type()}} + return &node{kind: funcType, action: aNop, rval: v, typ: valueTOf(v.Type())} } func genInterfaceWrapper(n *node, typ reflect.Type) func(*frame) reflect.Value { @@ -993,128 +1041,206 @@ func genInterfaceWrapper(n *node, typ reflect.Type) func(*frame) reflect.Value { if typ == nil || typ.Kind() != reflect.Interface || typ.NumMethod() == 0 || n.typ.cat == valueT { return value } - if nt := n.typ.TypeOf(); nt != nil && nt.Kind() == reflect.Interface { - return value + tc := n.typ.cat + if tc != structT { + // Always force wrapper generation for struct types, as they may contain + // embedded interface fields which require wrapping, even if reported as + // implementing typ by reflect. + if nt := n.typ.frameType(); nt != nil && nt.Implements(typ) { + return value + } } - mn := typ.NumMethod() + + // Retrieve methods from the interface wrapper, which is a struct where all fields + // except the first define the methods to implement. + // As the field name was generated with a prefixed first character (in order to avoid + // collisions with method names), this first character is ignored in comparisons. + wrap := getWrapper(n, typ) + mn := wrap.NumField() - 1 names := make([]string, mn) methods := make([]*node, mn) indexes := make([][]int, mn) for i := 0; i < mn; i++ { - names[i] = typ.Method(i).Name + names[i] = wrap.Field(i + 1).Name[1:] methods[i], indexes[i] = n.typ.lookupMethod(names[i]) if methods[i] == nil && n.typ.cat != nilT { // interpreted method not found, look for binary method, possibly embedded _, indexes[i], _, _ = n.typ.lookupBinMethod(names[i]) } } - wrap := n.interp.getWrapper(typ) return func(f *frame) reflect.Value { v := value(f) - vv := v + if tc != structT && v.Type().Implements(typ) { + return v + } switch v.Kind() { case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: if v.IsNil() { return reflect.New(typ).Elem() } - if v.Kind() == reflect.Ptr { - vv = v.Elem() - } } + var n2 *node + if vi, ok := v.Interface().(valueInterface); ok { + n2 = vi.node + } + v = getConcreteValue(v) w := reflect.New(wrap).Elem() + w.Field(0).Set(v) for i, m := range methods { if m == nil { - if r := v.MethodByName(names[i]); r.IsValid() { - w.Field(i).Set(r) + // First direct method lookup on field. + if r := methodByName(v, names[i], indexes[i]); r.IsValid() { + w.Field(i + 1).Set(r) continue } - o := vv.FieldByIndex(indexes[i]) - if r := o.MethodByName(names[i]); r.IsValid() { - w.Field(i).Set(r) - } else { - log.Println(n.cfgErrorf("genInterfaceWrapper error, no method %s", names[i])) + if n2 == nil { + panic(n.cfgErrorf("method not found: %s", names[i])) } - continue + // Method lookup in embedded valueInterface. + m2, i2 := n2.typ.lookupMethod(names[i]) + if m2 != nil { + nod := *m2 + nod.recv = &receiver{n, v, i2} + w.Field(i + 1).Set(genFunctionWrapper(&nod)(f)) + continue + } + panic(n.cfgErrorf("method not found: %s", names[i])) } nod := *m nod.recv = &receiver{n, v, indexes[i]} - w.Field(i).Set(genFunctionWrapper(&nod)(f)) + w.Field(i + 1).Set(genFunctionWrapper(&nod)(f)) } return w } } +// methodByName returns the method corresponding to name on value, or nil if not found. +// The search is extended on valueInterface wrapper if present. +// If valid, the returned value is a method function with the receiver already set +// (no need to pass it at call). +func methodByName(value reflect.Value, name string, index []int) (v reflect.Value) { + if vi, ok := value.Interface().(valueInterface); ok { + if v = getConcreteValue(vi.value).MethodByName(name); v.IsValid() { + return + } + } + if v = value.MethodByName(name); v.IsValid() { + return + } + for value.Kind() == reflect.Ptr { + value = value.Elem() + if checkFieldIndex(value.Type(), index) { + value = value.FieldByIndex(index) + } + if v = value.MethodByName(name); v.IsValid() { + return + } + } + return +} + +func checkFieldIndex(typ reflect.Type, index []int) bool { + if len(index) == 0 { + return false + } + t := typ + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + if t.Kind() != reflect.Struct { + return false + } + i := index[0] + if i >= t.NumField() { + return false + } + if len(index) > 1 { + return checkFieldIndex(t.Field(i).Type, index[1:]) + } + return true +} + func call(n *node) { goroutine := n.anc.kind == goStmt var method bool - value := genValue(n.child[0]) + c0 := n.child[0] + value := genValue(c0) var values []func(*frame) reflect.Value recvIndexLater := false switch { - case n.child[0].recv != nil: + case c0.recv != nil: // Compute method receiver value. - if isRecursiveType(n.child[0].recv.node.typ, n.child[0].recv.node.typ.rtype) { - values = append(values, genValueRecvInterfacePtr(n.child[0])) - } else { - values = append(values, genValueRecv(n.child[0])) - } + values = append(values, genValueRecv(c0)) method = true - case len(n.child[0].child) > 0 && n.child[0].child[0].typ != nil && n.child[0].child[0].typ.cat == interfaceT: + case len(c0.child) > 0 && c0.child[0].typ != nil && isInterfaceSrc(c0.child[0].typ): recvIndexLater = true - values = append(values, genValueBinRecv(n.child[0], &receiver{node: n.child[0].child[0]})) + values = append(values, genValueBinRecv(c0, &receiver{node: c0.child[0]})) value = genValueBinMethodOnInterface(n, value) method = true - case n.child[0].action == aMethod: + case c0.action == aMethod: // Add a place holder for interface method receiver. values = append(values, nil) method = true } - numRet := len(n.child[0].typ.ret) + numRet := len(c0.typ.ret) variadic := variadicPos(n) child := n.child[1:] tnext := getExec(n.tnext) fnext := getExec(n.fnext) + hasVariadicArgs := n.action == aCallSlice // callSlice implies variadic call with ellipsis. // Compute input argument value functions. for i, c := range child { + var arg *itype + if variadic >= 0 && i >= variadic { + arg = c0.typ.arg[variadic].val + } else { + arg = c0.typ.arg[i] + } switch { - case isBinCall(c): + case isBinCall(c, c.scope): // Handle nested function calls: pass returned values as arguments. numOut := c.child[0].typ.rtype.NumOut() for j := 0; j < numOut; j++ { ind := c.findex + j - values = append(values, func(f *frame) reflect.Value { return f.data[ind] }) + if hasVariadicArgs || !isInterfaceSrc(arg) || isEmptyInterface(arg) { + values = append(values, func(f *frame) reflect.Value { return f.data[ind] }) + continue + } + values = append(values, func(f *frame) reflect.Value { + return reflect.ValueOf(valueInterface{value: f.data[ind]}) + }) } case isRegularCall(c): // Arguments are return values of a nested function call. - for j := range c.child[0].typ.ret { + cc0 := c.child[0] + for j := range cc0.typ.ret { ind := c.findex + j - values = append(values, func(f *frame) reflect.Value { return f.data[ind] }) + if hasVariadicArgs || !isInterfaceSrc(arg) || isEmptyInterface(arg) { + values = append(values, func(f *frame) reflect.Value { return f.data[ind] }) + continue + } + values = append(values, func(f *frame) reflect.Value { + return reflect.ValueOf(valueInterface{node: cc0.typ.ret[j].node, value: f.data[ind]}) + }) } default: - var arg *itype - if variadic >= 0 && i >= variadic { - arg = n.child[0].typ.arg[variadic].val - } else { - arg = n.child[0].typ.arg[i] - } if c.kind == basicLit || c.rval.IsValid() { argType := arg.TypeOf() convertLiteralValue(c, argType) } switch { - case arg.cat == interfaceT: - if len(arg.field) > 0 { - values = append(values, genValueInterface(c)) - break - } - // empty interface, do not wrap it. + case hasVariadicArgs: values = append(values, genValue(c)) - case isRecursiveType(c.typ, c.typ.rtype): - values = append(values, genValueRecursiveInterfacePtrValue(c)) + case isInterfaceSrc(arg) && (!isEmptyInterface(arg) || len(c.typ.method) > 0): + values = append(values, genValueInterface(c)) + case isInterfaceBin(arg): + values = append(values, genInterfaceWrapper(c, arg.rtype)) + case isFuncSrc(arg): + values = append(values, genValueNode(c)) default: values = append(values, genValue(c)) } @@ -1122,43 +1248,29 @@ func call(n *node) { } // Compute output argument value functions. - rtypes := n.child[0].typ.ret + rtypes := c0.typ.ret rvalues := make([]func(*frame) reflect.Value, len(rtypes)) switch n.anc.kind { case defineXStmt, assignXStmt: + l := n.level for i := range rvalues { c := n.anc.child[i] switch { case c.ident == "_": // Skip assigning return value to blank var. - case c.typ.cat == interfaceT && rtypes[i].cat != interfaceT: - if len(c.typ.field) > 0 { - rvalues[i] = genValueInterfaceValue(c) - break - } - // empty interface, do not wrap - fallthrough + case isInterfaceSrc(c.typ) && !isEmptyInterface(c.typ) && !isInterfaceSrc(rtypes[i]): + rvalues[i] = genValueInterfaceValue(c) default: - rvalues[i] = genValue(c) + j := n.findex + i + rvalues[i] = func(f *frame) reflect.Value { return getFrame(f, l).data[j] } } } case returnStmt: // Function call from a return statement: forward return values (always at frame start). for i := range rtypes { j := n.findex + i - ret := n.child[0].typ.ret[i] - callret := n.anc.val.(*node).typ.ret[i] - if callret.cat == interfaceT && len(callret.field) > 0 && ret.cat != interfaceT { - // Wrap the returned value in a valueInterface in caller frame. - rvalues[i] = func(f *frame) reflect.Value { - v := reflect.New(ret.rtype).Elem() - f.data[j].Set(reflect.ValueOf(valueInterface{n, v})) - return v - } - } else { - // Set the return value location in return value of caller frame. - rvalues[i] = func(f *frame) reflect.Value { return f.data[j] } - } + // Set the return value location in return value of caller frame. + rvalues[i] = func(f *frame) reflect.Value { return f.data[j] } } default: // Multiple return values frame index are indexed from the node frame index. @@ -1171,7 +1283,7 @@ func call(n *node) { if n.anc.kind == deferStmt { // Store function call in frame for deferred execution. - value = genFunctionWrapper(n.child[0]) + value = genFunctionWrapper(c0) if method { // The receiver is already passed in the function wrapper, skip it. values = values[1:] @@ -1263,6 +1375,14 @@ func call(n *node) { src = def.recv.val } else { src = v(f) + for src.IsValid() { + // traverse interface indirections to find out concrete type + vi, ok := src.Interface().(valueInterface) + if !ok { + break + } + src = vi.value + } } if recvIndexLater && def.recv != nil && len(def.recv.index) > 0 { if src.Kind() == reflect.Ptr { @@ -1290,19 +1410,32 @@ func call(n *node) { } default: val := v(f) - if !val.IsZero() { - dest[i].Set(val) + if val.IsZero() && dest[i].Kind() != reflect.Interface { + // Work around a recursive struct zero interface issue. + // Once there is a better way to handle this case, the dest can just be set. + continue } + if nod, ok := val.Interface().(*node); ok && nod.recv != nil { + // An interpreted method is passed as value in a function call. + // It must be wrapped now, otherwise the receiver will be missing + // at the method call (#1332). + // TODO (marc): wrapping interpreted functions should be always done + // everywhere at runtime to simplify the whole code, + // but it requires deeper refactoring. + dest[i] = genFunctionWrapper(nod)(f) + continue + } + dest[i].Set(val) } } } // Execute function body if goroutine { - go runCfg(def.child[3].start, nf) + go runCfg(def.child[3].start, nf, def, n) return tnext } - runCfg(def.child[3].start, nf) + runCfg(def.child[3].start, nf, def, n) // Handle branching according to boolean result if fnext != nil && !nf.data[0].Bool() { @@ -1351,6 +1484,20 @@ func callBin(n *node) { } } + // getMapType returns a reflect type suitable for interface wrapper for functions + // with some special processing in case of interface{} argument, i.e. fmt.Printf. + var getMapType func(*itype) reflect.Type + if lr, ok := n.interp.mapTypes[c0.rval]; ok { + getMapType = func(typ *itype) reflect.Type { + for _, rt := range lr { + if typ.implements(&itype{cat: valueT, rtype: rt}) { + return rt + } + } + return nil + } + } + // Determine if we should use `Call` or `CallSlice` on the function Value. callFn := func(v reflect.Value, in []reflect.Value) []reflect.Value { return v.Call(in) } if n.action == aCallSlice { @@ -1358,15 +1505,8 @@ func callBin(n *node) { } for i, c := range child { - var defType reflect.Type - if variadic >= 0 && i >= variadic { - defType = funcType.In(variadic) - } else { - defType = funcType.In(rcvrOffset + i) - } - switch { - case isBinCall(c): + case isBinCall(c, c.scope): // Handle nested function calls: pass returned values as arguments numOut := c.child[0].typ.rtype.NumOut() for j := 0; j < numOut; j++ { @@ -1383,7 +1523,7 @@ func callBin(n *node) { if c.kind == basicLit || c.rval.IsValid() { // Convert literal value (untyped) to function argument type (if not an interface{}) var argType reflect.Type - if variadic >= 0 && i >= variadic { + if variadic >= 0 && i+rcvrOffset >= variadic { argType = funcType.In(variadic).Elem() } else { argType = funcType.In(i + rcvrOffset) @@ -1394,39 +1534,44 @@ func callBin(n *node) { } } - if wt != nil && wt.arg[i].cat == interfaceT { + if wt != nil && isInterfaceSrc(wt.arg[i]) { values = append(values, genValueInterface(c)) break } - switch c.typ.cat { - case funcT: - values = append(values, genFunctionWrapper(c)) - case interfaceT: - if len(c.typ.field) > 0 { - values = append(values, genValueInterfaceValue(c)) - break + // defType is the target type for a potential interface wrapper. + var defType reflect.Type + if variadic >= 0 && i+rcvrOffset >= variadic { + defType = funcType.In(variadic) + } else { + defType = funcType.In(rcvrOffset + i) + } + if getMapType != nil { + if rt := getMapType(c.typ); rt != nil { + defType = rt } - // empty interface, do not wrap it. + } + + switch { + case isFuncSrc(c.typ): + values = append(values, genFunctionWrapper(c)) + case isEmptyInterface(c.typ): values = append(values, genValue(c)) - case arrayT, variadicT: - switch c.typ.val.cat { - case interfaceT: - if len(c.typ.val.field) > 0 { - values = append(values, genValueInterfaceArray(c)) - break - } + case isInterfaceSrc(c.typ): + values = append(values, genValueInterfaceValue(c)) + case c.typ.cat == arrayT || c.typ.cat == variadicT: + if isEmptyInterface(c.typ.val) { values = append(values, genValueArray(c)) - default: + } else { values = append(values, genInterfaceWrapper(c, defType)) } - case ptrT: + case isPtrSrc(c.typ): if c.typ.val.cat == valueT { values = append(values, genValue(c)) } else { values = append(values, genInterfaceWrapper(c, defType)) } - case valueT: + case c.typ.cat == valueT: values = append(values, genValue(c)) default: values = append(values, genInterfaceWrapper(c, defType)) @@ -1442,7 +1587,7 @@ func callBin(n *node) { val := make([]reflect.Value, l+1) val[0] = value(f) for i, v := range values { - val[i+1] = v(f) + val[i+1] = getBinValue(getMapType, v, f) } f.deferred = append([][]reflect.Value{val}, f.deferred...) return tnext @@ -1452,7 +1597,7 @@ func callBin(n *node) { n.exec = func(f *frame) bltn { in := make([]reflect.Value, l) for i, v := range values { - in[i] = v(f) + in[i] = getBinValue(getMapType, v, f) } go callFn(value(f), in) return tnext @@ -1464,7 +1609,7 @@ func callBin(n *node) { n.exec = func(f *frame) bltn { in := make([]reflect.Value, l) for i, v := range values { - in[i] = v(f) + in[i] = getBinValue(getMapType, v, f) } res := callFn(value(f), in) b := res[0].Bool() @@ -1484,18 +1629,19 @@ func callBin(n *node) { rvalues := make([]func(*frame) reflect.Value, funcType.NumOut()) for i := range rvalues { c := n.anc.child[i] - if c.ident != "_" { - if c.typ.cat == interfaceT { - rvalues[i] = genValueInterfaceValue(c) - } else { - rvalues[i] = genValue(c) - } + if c.ident == "_" { + continue + } + if isInterfaceSrc(c.typ) { + rvalues[i] = genValueInterfaceValue(c) + } else { + rvalues[i] = genValue(c) } } n.exec = func(f *frame) bltn { in := make([]reflect.Value, l) for i, v := range values { - in[i] = v(f) + in[i] = getBinValue(getMapType, v, f) } out := callFn(value(f), in) for i, v := range rvalues { @@ -1512,11 +1658,15 @@ func callBin(n *node) { n.exec = func(f *frame) bltn { in := make([]reflect.Value, l) for i, v := range values { - in[i] = v(f) + in[i] = getBinValue(getMapType, v, f) } out := callFn(value(f), in) for i, v := range out { - f.data[b+i].Set(v) + dest := f.data[b+i] + if _, ok := dest.Interface().(valueInterface); ok { + v = reflect.ValueOf(valueInterface{value: v}) + } + dest.Set(v) } return tnext } @@ -1524,11 +1674,20 @@ func callBin(n *node) { n.exec = func(f *frame) bltn { in := make([]reflect.Value, l) for i, v := range values { - in[i] = v(f) + in[i] = getBinValue(getMapType, v, f) } out := callFn(value(f), in) for i := 0; i < len(out); i++ { - getFrame(f, n.level).data[n.findex+i].Set(out[i]) + r := out[i] + if r.Kind() == reflect.Func { + getFrame(f, n.level).data[n.findex+i] = r + continue + } + dest := getFrame(f, n.level).data[n.findex+i] + if _, ok := dest.Interface().(valueInterface); ok { + r = reflect.ValueOf(valueInterface{value: r}) + } + dest.Set(r) } return tnext } @@ -1552,6 +1711,20 @@ func getIndexBinMethod(n *node) { } } +func getIndexBinElemMethod(n *node) { + i := n.findex + l := n.level + m := n.val.(int) + value := genValue(n.child[0]) + next := getExec(n.tnext) + + n.exec = func(f *frame) bltn { + // Can not use .Set() because dest type contains the receiver and source not + getFrame(f, l).data[i] = value(f).Elem().Method(m) + return next + } +} + func getIndexBinPtrMethod(n *node) { i := n.findex l := n.level @@ -1615,9 +1788,6 @@ func getIndexArray(n *node) { } } -// valueInterfaceType is the reflection type of valueInterface. -var valueInterfaceType = reflect.TypeOf((*valueInterface)(nil)).Elem() - // getIndexMap retrieves map value from index. func getIndexMap(n *node) { dest := genValue(n) @@ -1639,27 +1809,6 @@ func getIndexMap(n *node) { dest(f).Set(z) return fnext } - case n.typ.cat == interfaceT: - z = reflect.New(n.child[0].typ.val.frameType()).Elem() - n.exec = func(f *frame) bltn { - v := value0(f).MapIndex(mi) - if !v.IsValid() { - dest(f).Set(z) - return tnext - } - e := v.Elem() - if len(n.typ.field) == 0 { - // e is empty interface, do not wrap - dest(f).Set(e) - return tnext - } - if e.Type().AssignableTo(valueInterfaceType) { - dest(f).Set(e) - return tnext - } - dest(f).Set(reflect.ValueOf(valueInterface{n, e})) - return tnext - } default: n.exec = func(f *frame) bltn { if v := value0(f).MapIndex(mi); v.IsValid() { @@ -1684,20 +1833,6 @@ func getIndexMap(n *node) { dest(f).Set(z) return fnext } - case n.typ.cat == interfaceT: - z = reflect.New(n.child[0].typ.val.frameType()).Elem() - n.exec = func(f *frame) bltn { - if v := value0(f).MapIndex(value1(f)); v.IsValid() { - if e := v.Elem(); e.Type().AssignableTo(valueInterfaceType) { - dest(f).Set(e) - } else { - dest(f).Set(reflect.ValueOf(valueInterface{n, e})) - } - } else { - dest(f).Set(z) - } - return tnext - } default: n.exec = func(f *frame) bltn { if v := value0(f).MapIndex(value1(f)); v.IsValid() { @@ -1717,7 +1852,6 @@ func getIndexMap2(n *node) { value0 := genValue(n.child[0]) // map value2 := genValue(n.anc.child[1]) // status next := getExec(n.tnext) - typ := n.anc.child[0].typ doValue := n.anc.child[0].ident != "_" doStatus := n.anc.child[1].ident != "_" @@ -1734,21 +1868,6 @@ func getIndexMap2(n *node) { value2(f).SetBool(v.IsValid()) return next } - case typ.cat == interfaceT: - n.exec = func(f *frame) bltn { - v := value0(f).MapIndex(mi) - if v.IsValid() { - if e := v.Elem(); e.Type().AssignableTo(valueInterfaceType) { - dest(f).Set(e) - } else { - dest(f).Set(reflect.ValueOf(valueInterface{n, e})) - } - } - if doStatus { - value2(f).SetBool(v.IsValid()) - } - return next - } default: n.exec = func(f *frame) bltn { v := value0(f).MapIndex(mi) @@ -1770,21 +1889,6 @@ func getIndexMap2(n *node) { value2(f).SetBool(v.IsValid()) return next } - case typ.cat == interfaceT: - n.exec = func(f *frame) bltn { - v := value0(f).MapIndex(value1(f)) - if v.IsValid() { - if e := v.Elem(); e.Type().AssignableTo(valueInterfaceType) { - dest(f).Set(e) - } else { - dest(f).Set(reflect.ValueOf(valueInterface{n, e})) - } - } - if doStatus { - value2(f).SetBool(v.IsValid()) - } - return next - } default: n.exec = func(f *frame) bltn { v := value0(f).MapIndex(value1(f)) @@ -1848,16 +1952,47 @@ func getMethodByName(n *node) { } val = v } + + if met := val.value.MethodByName(name); met.IsValid() { + getFrame(f, l).data[i] = met + return next + } + typ := val.node.typ if typ.node == nil && typ.cat == valueT { // happens with a var of empty interface type, that has value of concrete type // from runtime, being asserted to "user-defined" interface. if _, ok := typ.rtype.MethodByName(name); !ok { - panic(fmt.Sprintf("method %s not found", name)) + panic(n.cfgErrorf("method not found: %s", name)) } return next } - m, li := val.node.typ.lookupMethod(name) + + m, li := typ.lookupMethod(name) + + // Try harder to find a matching embedded valueInterface. + // TODO (marc): make sure it works for arbitrary depth and breadth. + if m == nil && isStruct(val.node.typ) { + v := val.value + for v.Type().Kind() == reflect.Ptr { + v = v.Elem() + } + nf := v.NumField() + for i := 0; i < nf; i++ { + var ok bool + if val, ok = v.Field(i).Interface().(valueInterface); !ok { + continue + } + if m, li = val.node.typ.lookupMethod(name); m != nil { + break + } + } + } + + if m == nil { + panic(n.cfgErrorf("method not found: %s", name)) + } + fr := f.clone(!fork) nod := *m nod.val = &nod @@ -1889,9 +2024,6 @@ func getIndexSeq(n *node) { fnext := getExec(n.fnext) n.exec = func(f *frame) bltn { v := value(f) - if v.Type().Kind() == reflect.Interface && n.child[0].typ.recursive { - v = writableDeref(v) - } r := v.FieldByIndex(index) getFrame(f, l).data[i] = r if r.Bool() { @@ -1902,33 +2034,16 @@ func getIndexSeq(n *node) { } else { n.exec = func(f *frame) bltn { v := value(f) - if v.Type().Kind() == reflect.Interface && n.child[0].typ.recursive { - v = writableDeref(v) - } getFrame(f, l).data[i] = v.FieldByIndex(index) return tnext } } } -//go:nocheckptr -func writableDeref(v reflect.Value) reflect.Value { - // Here we have an interface to a struct. Any attempt to dereference it will - // make a copy of the struct. We need to get a Value to the actual struct. - // TODO: using unsafe is a temporary measure. Rethink this. - return reflect.NewAt(v.Elem().Type(), unsafe.Pointer(v.InterfaceData()[1])).Elem() //nolint:govet -} - func getPtrIndexSeq(n *node) { index := n.val.([]int) tnext := getExec(n.tnext) - var value func(*frame) reflect.Value - if isRecursiveType(n.child[0].typ, n.child[0].typ.rtype) { - v := genValue(n.child[0]) - value = func(f *frame) reflect.Value { return v(f).Elem().Elem() } - } else { - value = genValue(n.child[0]) - } + value := genValue(n.child[0]) i := n.findex l := n.level @@ -2003,14 +2118,28 @@ func getIndexSeqPtrMethod(n *node) { next := getExec(n.tnext) if n.child[0].typ.TypeOf().Kind() == reflect.Ptr { - n.exec = func(f *frame) bltn { - getFrame(f, l).data[i] = value(f).Elem().FieldByIndex(fi).Addr().Method(mi) - return next + if len(fi) == 0 { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Method(mi) + return next + } + } else { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Elem().FieldByIndex(fi).Addr().Method(mi) + return next + } } } else { - n.exec = func(f *frame) bltn { - getFrame(f, l).data[i] = value(f).FieldByIndex(fi).Addr().Method(mi) - return next + if len(fi) == 0 { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Addr().Method(mi) + return next + } + } else { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).FieldByIndex(fi).Addr().Method(mi) + return next + } } } } @@ -2025,14 +2154,28 @@ func getIndexSeqMethod(n *node) { next := getExec(n.tnext) if n.child[0].typ.TypeOf().Kind() == reflect.Ptr { - n.exec = func(f *frame) bltn { - getFrame(f, l).data[i] = value(f).Elem().FieldByIndex(fi).Method(mi) - return next + if len(fi) == 0 { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Elem().Method(mi) + return next + } + } else { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Elem().FieldByIndex(fi).Method(mi) + return next + } } } else { - n.exec = func(f *frame) bltn { - getFrame(f, l).data[i] = value(f).FieldByIndex(fi).Method(mi) - return next + if len(fi) == 0 { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).Method(mi) + return next + } + } else { + n.exec = func(f *frame) bltn { + getFrame(f, l).data[i] = value(f).FieldByIndex(fi).Method(mi) + return next + } } } } @@ -2255,9 +2398,13 @@ func _return(n *node) { } values[i] = genValueInterface(c) case valueT: - if t.rtype.Kind() == reflect.Interface { + switch t.rtype.Kind() { + case reflect.Interface: values[i] = genInterfaceWrapper(c, t.rtype) - break + continue + case reflect.Func: + values[i] = genFunctionWrapper(c) + continue } fallthrough default: @@ -2273,12 +2420,16 @@ func _return(n *node) { case 0: n.exec = nil case 1: - // This is an optimisation that is applied for binary expressions or function - // calls, but not for (binary) expressions involving const, as the values are not - // stored in the frame in that case. - if !child[0].rval.IsValid() && child[0].kind == binaryExpr || isCall(child[0]) { + switch { + case !child[0].rval.IsValid() && child[0].kind == binaryExpr: + // No additional runtime operation is necessary for constants (not in frame) or + // binary expressions (stored directly at the right location in frame). n.exec = nil - } else { + case isCall(child[0]) && n.child[0].typ.id() == def.typ.ret[0].id(): + // Calls are optmized as long as no type conversion is involved. + n.exec = nil + default: + // Regular return: store the value to return at to start of the frame. v := values[0] n.exec = func(f *frame) bltn { f.data[0].Set(v(f)) @@ -2312,25 +2463,15 @@ func arrayLit(n *node) { values := make([]func(*frame) reflect.Value, len(child)) index := make([]int, len(child)) - rtype := n.typ.val.TypeOf() var max, prev int + ntyp := n.typ.resolveAlias() for i, c := range child { if c.kind == keyValueExpr { - convertLiteralValue(c.child[1], rtype) - if n.typ.val.cat == interfaceT && len(n.typ.val.field) > 0 { - values[i] = genValueInterface(c.child[1]) - } else { - values[i] = genValue(c.child[1]) - } + values[i] = genDestValue(ntyp.val, c.child[1]) index[i] = int(vInt(c.child[0].rval)) } else { - convertLiteralValue(c, rtype) - if n.typ.val.cat == interfaceT && len(n.typ.val.field) > 0 { - values[i] = genValueInterface(c) - } else { - values[i] = genValue(c) - } + values[i] = genDestValue(ntyp.val, c) index[i] = prev } prev = index[i] + 1 @@ -2340,12 +2481,13 @@ func arrayLit(n *node) { } typ := n.typ.frameType() + kind := typ.Kind() n.exec = func(f *frame) bltn { var a reflect.Value - if n.typ.sizedef { - a, _ = n.typ.zero() - } else { + if kind == reflect.Slice { a = reflect.MakeSlice(typ, max, max) + } else { + a, _ = n.typ.zero() } for i, v := range values { a.Index(index[i]).Set(v(f)) @@ -2362,22 +2504,12 @@ func mapLit(n *node) { if n.nleft == 1 { child = n.child[1:] } - typ := n.typ.TypeOf() + typ := n.typ.frameType() keys := make([]func(*frame) reflect.Value, len(child)) values := make([]func(*frame) reflect.Value, len(child)) for i, c := range child { - convertLiteralValue(c.child[0], n.typ.key.TypeOf()) - convertLiteralValue(c.child[1], n.typ.val.TypeOf()) - if n.typ.key.cat == interfaceT { - keys[i] = genValueInterface(c.child[0]) - } else { - keys[i] = genValue(c.child[0]) - } - if n.typ.val.cat == interfaceT && len(n.typ.val.field) > 0 { - values[i] = genValueInterface(c.child[1]) - } else { - values[i] = genValue(c.child[1]) - } + keys[i] = genDestValue(n.typ.key, c.child[0]) + values[i] = genDestValue(n.typ.val, c.child[1]) } n.exec = func(f *frame) bltn { @@ -2397,7 +2529,7 @@ func compositeBinMap(n *node) { if n.nleft == 1 { child = n.child[1:] } - typ := n.typ.TypeOf() + typ := n.typ.frameType() keys := make([]func(*frame) reflect.Value, len(child)) values := make([]func(*frame) reflect.Value, len(child)) for i, c := range child { @@ -2405,7 +2537,7 @@ func compositeBinMap(n *node) { convertLiteralValue(c.child[1], typ.Elem()) keys[i] = genValue(c.child[0]) - if c.child[1].typ.cat == funcT { + if isFuncSrc(c.child[1].typ) { values[i] = genFunctionWrapper(c.child[1]) } else { values[i] = genValue(c.child[1]) @@ -2452,12 +2584,13 @@ func compositeBinSlice(n *node) { } typ := n.typ.frameType() + kind := typ.Kind() n.exec = func(f *frame) bltn { var a reflect.Value - if n.typ.sizedef { - a, _ = n.typ.zero() - } else { + if kind == reflect.Slice { a = reflect.MakeSlice(typ, max, max) + } else { + a, _ = n.typ.zero() } for i, v := range values { a.Index(index[i]).Set(v(f)) @@ -2486,7 +2619,7 @@ func doCompositeBinStruct(n *node, hasType bool) { if sf, ok := typ.FieldByName(c.child[0].ident); ok { fieldIndex[i] = sf.Index convertLiteralValue(c.child[1], sf.Type) - if c.child[1].typ.cat == funcT { + if isFuncSrc(c.child[1].typ) { values[i] = genFunctionWrapper(c.child[1]) } else { values[i] = genValue(c.child[1]) @@ -2494,7 +2627,7 @@ func doCompositeBinStruct(n *node, hasType bool) { } } else { fieldIndex[i] = []int{i} - if c.typ.cat == funcT && len(c.child) > 1 { + if isFuncSrc(c.typ) && len(c.child) > 1 { convertLiteralValue(c.child[1], typ.Field(i).Type) values[i] = genFunctionWrapper(c.child[1]) } else { @@ -2504,6 +2637,9 @@ func doCompositeBinStruct(n *node, hasType bool) { } } + frameIndex := n.findex + l := n.level + n.exec = func(f *frame) bltn { s := reflect.New(typ).Elem() for i, v := range values { @@ -2511,10 +2647,10 @@ func doCompositeBinStruct(n *node, hasType bool) { } d := value(f) switch { - case d.Type().Kind() == reflect.Ptr: + case d.Kind() == reflect.Ptr: d.Set(s.Addr()) default: - d.Set(s) + getFrame(f, l).data[frameIndex] = s } return next } @@ -2539,13 +2675,11 @@ func doComposite(n *node, hasType bool, keyed bool) { if typ.cat == ptrT || typ.cat == aliasT { typ = typ.val } - var mu sync.Mutex - typ.mu = &mu child := n.child if hasType { child = n.child[1:] } - destInterface := destType(n).cat == interfaceT + destInterface := isInterfaceSrc(destType(n)) values := make(map[int]func(*frame) reflect.Value) for i, c := range child { @@ -2564,12 +2698,10 @@ func doComposite(n *node, hasType bool, keyed bool) { switch { case val.typ.cat == nilT: values[fieldIndex] = func(*frame) reflect.Value { return reflect.New(rft).Elem() } - case val.typ.cat == funcT: + case isFuncSrc(val.typ): values[fieldIndex] = genValueAsFunctionWrapper(val) - case isArray(val.typ) && val.typ.val != nil && val.typ.val.cat == interfaceT: - values[fieldIndex] = genValueInterfaceArray(val) - case isRecursiveType(ft, rft): - values[fieldIndex] = genValueRecursiveInterface(val, rft) + case isInterfaceSrc(ft) && (!isEmptyInterface(ft) || len(val.typ.method) > 0): + values[fieldIndex] = genValueInterface(val) case isInterface(ft): values[fieldIndex] = genInterfaceWrapper(val, rft) default: @@ -2579,17 +2711,16 @@ func doComposite(n *node, hasType bool, keyed bool) { frameIndex := n.findex l := n.level + rt := typ.TypeOf() + n.exec = func(f *frame) bltn { - typ.mu.Lock() - // No need to call zero() as doComposite is only called for a structT. - a := reflect.New(typ.TypeOf()).Elem() - typ.mu.Unlock() + a := reflect.New(rt).Elem() for i, v := range values { a.Field(i).Set(v(f)) } d := value(f) switch { - case d.Type().Kind() == reflect.Ptr: + case d.Kind() == reflect.Ptr: d.Set(a.Addr()) case destInterface: if len(destType(n).field) > 0 { @@ -2627,31 +2758,50 @@ var rat = reflect.ValueOf((*[]rune)(nil)).Type().Elem() // runes array type func _range(n *node) { index0 := n.child[0].findex // array index location in frame index2 := index0 - 1 // shallow array for range, always just behind index0 + index3 := index2 - 1 // additional location to store string char position fnext := getExec(n.fnext) tnext := getExec(n.tnext) var value func(*frame) reflect.Value + var an *node if len(n.child) == 4 { - an := n.child[2] + an = n.child[2] index1 := n.child[1].findex // array value location in frame if isString(an.typ.TypeOf()) { + // Special variant of "range" for string, where the index indicates the byte position + // of the rune in the string, rather than the index of the rune in array. + stringType := reflect.TypeOf("") value = genValueAs(an, rat) // range on string iterates over runes + n.exec = func(f *frame) bltn { + a := f.data[index2] + v0 := f.data[index3] + v0.SetInt(v0.Int() + 1) + i := int(v0.Int()) + if i >= a.Len() { + return fnext + } + // Compute byte position of the rune in string + pos := a.Slice(0, i).Convert(stringType).Len() + f.data[index0].SetInt(int64(pos)) + f.data[index1].Set(a.Index(i)) + return tnext + } } else { value = genValueRangeArray(an) - } - n.exec = func(f *frame) bltn { - a := f.data[index2] - v0 := f.data[index0] - v0.SetInt(v0.Int() + 1) - i := int(v0.Int()) - if i >= a.Len() { - return fnext + n.exec = func(f *frame) bltn { + a := f.data[index2] + v0 := f.data[index0] + v0.SetInt(v0.Int() + 1) + i := int(v0.Int()) + if i >= a.Len() { + return fnext + } + f.data[index1].Set(a.Index(i)) + return tnext } - f.data[index1].Set(a.Index(i)) - return tnext } } else { - an := n.child[1] + an = n.child[1] if isString(an.typ.TypeOf()) { value = genValueAs(an, rat) // range on string iterates over runes } else { @@ -2669,9 +2819,13 @@ func _range(n *node) { // Init sequence next := n.exec + index := index0 + if isString(an.typ.TypeOf()) && len(n.child) == 4 { + index = index3 + } n.child[0].exec = func(f *frame) bltn { f.data[index2] = value(f) // set array shallow copy for range - f.data[index0].SetInt(-1) // assing index value + f.data[index].SetInt(-1) // assing index value return next } } @@ -2709,47 +2863,14 @@ func rangeMap(n *node) { if len(n.child) == 4 { index1 := n.child[1].findex // map value location in frame value = genValue(n.child[2]) // map - if n.child[1].typ.cat == interfaceT { - if len(n.child[1].typ.field) > 0 { - n.exec = func(f *frame) bltn { - iter := f.data[index2].Interface().(*reflect.MapIter) - if !iter.Next() { - return fnext - } - f.data[index0].Set(iter.Key()) - if e := iter.Value().Elem(); e.Type().AssignableTo(valueInterfaceType) { - f.data[index1].Set(e) - } else { - f.data[index1].Set(reflect.ValueOf(valueInterface{n, e})) - } - return tnext - } - } else { - // empty interface, do not wrap - n.exec = func(f *frame) bltn { - iter := f.data[index2].Interface().(*reflect.MapIter) - if !iter.Next() { - return fnext - } - f.data[index0].Set(iter.Key()) - if iter.Value().Elem().IsValid() { - f.data[index1].Set(iter.Value().Elem()) - } else { - f.data[index1].Set(reflect.New(interf).Elem()) - } - return tnext - } - } - } else { - n.exec = func(f *frame) bltn { - iter := f.data[index2].Interface().(*reflect.MapIter) - if !iter.Next() { - return fnext - } - f.data[index0].Set(iter.Key()) - f.data[index1].Set(iter.Value()) - return tnext + n.exec = func(f *frame) bltn { + iter := f.data[index2].Interface().(*reflect.MapIter) + if !iter.Next() { + return fnext } + f.data[index0].Set(iter.Key()) + f.data[index1].Set(iter.Value()) + return tnext } } else { value = genValue(n.child[1]) // map @@ -2855,13 +2976,22 @@ func _case(n *node) { if typ.cat == nilT && v.IsNil() { return tnext } - if typ.TypeOf().String() == t.String() { - destValue(f).Set(v.Elem()) + rtyp := typ.TypeOf() + if rtyp == nil { + return fnext + } + elem := v.Elem() + if rtyp.String() == t.String() && implementsInterface(v, typ) { + destValue(f).Set(elem) return tnext } ival := v.Interface() - if ival != nil && typ.TypeOf().String() == reflect.TypeOf(ival).String() { - destValue(f).Set(v.Elem()) + if ival != nil && rtyp.String() == reflect.TypeOf(ival).String() { + destValue(f).Set(elem) + return tnext + } + if typ.cat == valueT && rtyp.Kind() == reflect.Interface && elem.IsValid() && elem.Type().Implements(rtyp) { + destValue(f).Set(elem) return tnext } return fnext @@ -2879,12 +3009,37 @@ func _case(n *node) { } return fnext } + default: - // TODO(mpl): probably needs to be fixed for empty interfaces, like above. - // match against multiple types: assign var to interface value n.exec = func(f *frame) bltn { val := srcValue(f) - if v := srcValue(f).Interface().(valueInterface).node; v != nil { + if t := val.Type(); t.Kind() == reflect.Interface { + for _, typ := range types { + if typ.cat == nilT && val.IsNil() { + return tnext + } + rtyp := typ.TypeOf() + if rtyp == nil { + continue + } + elem := val.Elem() + if rtyp.String() == t.String() && implementsInterface(val, typ) { + destValue(f).Set(elem) + return tnext + } + ival := val.Interface() + if ival != nil && rtyp.String() == reflect.TypeOf(ival).String() { + destValue(f).Set(elem) + return tnext + } + if typ.cat == valueT && rtyp.Kind() == reflect.Interface && elem.IsValid() && elem.Type().Implements(rtyp) { + destValue(f).Set(elem) + return tnext + } + } + return fnext + } + if v := val.Interface().(valueInterface).node; v != nil { for _, typ := range types { if v.typ.id() == typ.id() { destValue(f).Set(val) @@ -2923,6 +3078,22 @@ func _case(n *node) { } } +func implementsInterface(v reflect.Value, t *itype) bool { + rt := v.Type() + if t.cat == valueT { + return rt.Implements(t.rtype) + } + vt := &itype{cat: valueT, rtype: rt} + if vt.methods().contains(t.methods()) { + return true + } + vi, ok := v.Interface().(valueInterface) + if !ok { + return false + } + return vi.node != nil && vi.node.typ.methods().contains(t.methods()) +} + func appendSlice(n *node) { dest := genValueOutput(n, n.typ.rtype) next := getExec(n.tnext) @@ -2947,7 +3118,7 @@ func _append(n *node) { if len(n.child) == 3 { c1, c2 := n.child[1], n.child[2] if (c1.typ.cat == valueT || c2.typ.cat == valueT) && c1.typ.rtype == c2.typ.rtype || - c2.typ.cat == arrayT && c2.typ.val.id() == n.typ.val.id() || + isArray(c2.typ) && c2.typ.elem().id() == n.typ.elem().id() || isByteArray(c1.typ.TypeOf()) && isString(c2.typ.TypeOf()) { appendSlice(n) return @@ -2958,20 +3129,22 @@ func _append(n *node) { value := genValue(n.child[1]) next := getExec(n.tnext) - if len(n.child) > 3 { + switch l := len(n.child); { + case l == 2: + n.exec = func(f *frame) bltn { + dest(f).Set(value(f)) + return next + } + case l > 3: args := n.child[2:] l := len(args) values := make([]func(*frame) reflect.Value, l) for i, arg := range args { - switch { - case n.typ.val.cat == interfaceT: - if len(n.typ.val.field) > 0 { - values[i] = genValueInterface(arg) - break - } - values[i] = genValue(arg) - case isRecursiveType(n.typ.val, n.typ.val.rtype): - values[i] = genValueRecursiveInterface(arg, n.typ.val.rtype) + switch elem := n.typ.elem(); { + case isInterfaceSrc(elem) && (!isEmptyInterface(elem) || len(arg.typ.method) > 0): + values[i] = genValueInterface(arg) + case isInterfaceBin(elem): + values[i] = genInterfaceWrapper(arg, elem.rtype) case arg.typ.untyped: values[i] = genValueAs(arg, n.child[1].typ.TypeOf().Elem()) default: @@ -2987,17 +3160,13 @@ func _append(n *node) { dest(f).Set(reflect.Append(value(f), sl...)) return next } - } else { + default: var value0 func(*frame) reflect.Value - switch { - case n.typ.val.cat == interfaceT: - if len(n.typ.val.field) > 0 { - value0 = genValueInterface(n.child[2]) - break - } - value0 = genValue(n.child[2]) - case isRecursiveType(n.typ.val, n.typ.val.rtype): - value0 = genValueRecursiveInterface(n.child[2], n.typ.val.rtype) + switch elem := n.typ.elem(); { + case isInterfaceSrc(elem) && (!isEmptyInterface(elem) || len(n.child[2].typ.method) > 0): + value0 = genValueInterface(n.child[2]) + case isInterfaceBin(elem): + value0 = genInterfaceWrapper(n.child[2], elem.rtype) case n.child[2].typ.untyped: value0 = genValueAs(n.child[2], n.child[1].typ.TypeOf().Elem()) default: @@ -3130,23 +3299,37 @@ func _delete(n *node) { } func capConst(n *node) { - n.rval = reflect.New(reflect.TypeOf(int(0))).Elem() // There is no Cap() method for reflect.Type, just return Len() instead. - n.rval.SetInt(int64(n.child[1].typ.TypeOf().Len())) + lenConst(n) } func lenConst(n *node) { n.rval = reflect.New(reflect.TypeOf(int(0))).Elem() - if c1 := n.child[1]; c1.rval.IsValid() { + c1 := n.child[1] + if c1.rval.IsValid() { n.rval.SetInt(int64(len(vString(c1.rval)))) - } else { - n.rval.SetInt(int64(c1.typ.TypeOf().Len())) + return } + t := c1.typ.TypeOf() + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + n.rval.SetInt(int64(t.Len())) } func _len(n *node) { dest := genValueOutput(n, reflect.TypeOf(int(0))) value := genValue(n.child[1]) + if isPtr(n.child[1].typ) { + val := value + value = func(f *frame) reflect.Value { + v := val(f).Elem() + for v.Kind() == reflect.Ptr { + v = v.Elem() + } + return v + } + } next := getExec(n.tnext) if wantEmptyInterface(n) { @@ -3164,11 +3347,20 @@ func _len(n *node) { func _new(n *node) { next := getExec(n.tnext) - typ := n.child[1].typ.TypeOf() + t1 := n.child[1].typ + typ := t1.TypeOf() dest := genValueOutput(n, reflect.PtrTo(typ)) + if isInterfaceSrc(t1) && (!isEmptyInterface(t1) || len(t1.method) > 0) { + typ = zeroInterfaceValue().Type() + } + n.exec = func(f *frame) bltn { - dest(f).Set(reflect.New(typ)) + v := reflect.New(typ) + if vi, ok := v.Interface().(*valueInterface); ok { + vi.node = n + } + dest(f).Set(v) return next } } @@ -3388,7 +3580,7 @@ func convertLiteralValue(n *node, t reflect.Type) { case n.typ.cat == nilT: // Create a zero value of target type. n.rval = reflect.New(t).Elem() - case !(n.kind == basicLit || n.rval.IsValid()) || t == nil || t.Kind() == reflect.Interface || t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Interface: + case !(n.kind == basicLit || n.rval.IsValid()) || t == nil || t.Kind() == reflect.Interface || t == valueInterfaceType || t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Interface: // Skip non-constant values, undefined target type or interface target type. case n.rval.IsValid(): // Convert constant value to target type. @@ -3439,15 +3631,7 @@ func send(n *node) { next := getExec(n.tnext) c0, c1 := n.child[0], n.child[1] value0 := genValue(c0) // Send channel. - convertLiteralValue(c1, c0.typ.val.TypeOf()) - - var value1 func(*frame) reflect.Value // Value to send. - switch { - case isInterfaceBin(c0.typ.val): - value1 = genInterfaceWrapper(c1, c0.typ.val.rtype) - default: - value1 = genValue(c1) - } + value1 := genDestValue(c0.typ.val, c1) if !n.interp.cancelChan { // Send is non-cancellable, has the least overhead. @@ -3657,7 +3841,7 @@ func slice0(n *node) { func isNil(n *node) { var value func(*frame) reflect.Value c0 := n.child[0] - if c0.typ.cat == funcT { + if isFuncSrc(c0.typ) { value = genValueAsFunctionWrapper(c0) } else { value = genValue(c0) @@ -3668,7 +3852,7 @@ func isNil(n *node) { dest := genValue(n) if n.fnext == nil { - if c0.typ.cat != interfaceT { + if !isInterfaceSrc(c0.typ) { if isInterface { n.exec = func(f *frame) bltn { dest(f).Set(reflect.ValueOf(value(f).IsNil()).Convert(typ)) @@ -3712,7 +3896,7 @@ func isNil(n *node) { fnext := getExec(n.fnext) - if c0.typ.cat != interfaceT { + if !isInterfaceSrc(c0.typ) { n.exec = func(f *frame) bltn { if value(f).IsNil() { dest(f).SetBool(true) @@ -3746,7 +3930,7 @@ func isNil(n *node) { func isNotNil(n *node) { var value func(*frame) reflect.Value c0 := n.child[0] - if c0.typ.cat == funcT { + if isFuncSrc(c0.typ) { value = genValueAsFunctionWrapper(c0) } else { value = genValue(c0) @@ -3757,7 +3941,7 @@ func isNotNil(n *node) { dest := genValue(n) if n.fnext == nil { - if c0.typ.cat != interfaceT { + if isInterfaceSrc(c0.typ) && c0.typ.TypeOf() != valueInterfaceType { if isInterface { n.exec = func(f *frame) bltn { dest(f).Set(reflect.ValueOf(!value(f).IsNil()).Convert(typ)) @@ -3802,7 +3986,7 @@ func isNotNil(n *node) { fnext := getExec(n.fnext) - if c0.typ.cat != interfaceT { + if isInterfaceSrc(c0.typ) && c0.typ.TypeOf() != valueInterfaceType { n.exec = func(f *frame) bltn { if value(f).IsNil() { dest(f).SetBool(false) diff --git a/vendor/github.com/traefik/yaegi/interp/scope.go b/vendor/github.com/traefik/yaegi/interp/scope.go index bfeeba5..52087ae 100644 --- a/vendor/github.com/traefik/yaegi/interp/scope.go +++ b/vendor/github.com/traefik/yaegi/interp/scope.go @@ -11,27 +11,29 @@ type sKind uint // Symbol kinds for the Go interpreter. const ( - undefSym sKind = iota - binSym // Binary from runtime - bltnSym // Builtin - constSym // Constant - funcSym // Function - labelSym // Label - pkgSym // Package - typeSym // Type - varSym // Variable + undefSym sKind = iota + binSym // Binary from runtime + bltnSym // Builtin + constSym // Constant + funcSym // Function + labelSym // Label + pkgSym // Package + typeSym // Type + varTypeSym // Variable type (generic) + varSym // Variable ) var symKinds = [...]string{ - undefSym: "undefSym", - binSym: "binSym", - bltnSym: "bltnSym", - constSym: "constSym", - funcSym: "funcSym", - labelSym: "labelSym", - pkgSym: "pkgSym", - typeSym: "typeSym", - varSym: "varSym", + undefSym: "undefSym", + binSym: "binSym", + bltnSym: "bltnSym", + constSym: "constSym", + funcSym: "funcSym", + labelSym: "labelSym", + pkgSym: "pkgSym", + typeSym: "typeSym", + varTypeSym: "varTypeSym", + varSym: "varSym", } func (k sKind) String() string { @@ -47,7 +49,7 @@ type symbol struct { kind sKind typ *itype // Type of value node *node // Node value if index is negative - from []*node // list of nodes jumping to node if kind is label, or nil + from []*node // list of goto nodes jumping to this label node, or nil recv *receiver // receiver node value, if sym refers to a method index int // index of value in frame or -1 rval reflect.Value // default value (used for constants) @@ -70,7 +72,6 @@ type symbol struct { // // In symbols, the index value corresponds to the index in scope.types, and at // execution to the index in frame, created exactly from the types layout. -// type scope struct { anc *scope // ancestor upper scope child []*scope // included scopes @@ -78,6 +79,7 @@ type scope struct { loop *node // loop exit node for break statement loopRestart *node // loop restart node for continue statement pkgID string // unique id of package in which scope is defined + pkgName string // package name for the package types []reflect.Type // frame layout, may be shared by same level scopes level int // frame level: number of frame indirections to access var during execution sym map[string]*symbol // map of symbols defined in this current scope @@ -143,20 +145,6 @@ func (s *scope) lookup(ident string) (*symbol, int, bool) { return nil, 0, false } -// lookdown searches for a symbol in the current scope and included ones, recursively. -// It returns the first found symbol and true, or nil and false. -func (s *scope) lookdown(ident string) (*symbol, bool) { - if sym, ok := s.sym[ident]; ok { - return sym, true - } - for _, c := range s.child { - if sym, ok := c.lookdown(ident); ok { - return sym, true - } - } - return nil, false -} - func (s *scope) rangeChanType(n *node) *itype { if sym, _, found := s.lookup(n.child[1].ident); found { if t := sym.typ; len(n.child) == 3 && t != nil && (t.cat == chanT || t.cat == chanRecvT) { @@ -172,7 +160,14 @@ func (s *scope) rangeChanType(n *node) *itype { case c.typ.cat == chanT, c.typ.cat == chanRecvT: return c.typ case c.typ.cat == valueT && c.typ.rtype.Kind() == reflect.Chan: - return &itype{cat: chanT, val: &itype{cat: valueT, rtype: c.typ.rtype.Elem()}} + dir := chanSendRecv + switch c.typ.rtype.ChanDir() { + case reflect.RecvDir: + dir = chanRecv + case reflect.SendDir: + dir = chanSend + } + return chanOf(valueTOf(c.typ.rtype.Elem()), dir) } return nil @@ -220,7 +215,7 @@ func (s *scope) add(typ *itype) (index int) { return } -func (interp *Interpreter) initScopePkg(pkgID string) *scope { +func (interp *Interpreter) initScopePkg(pkgID, pkgName string) *scope { sc := interp.universe interp.mutex.Lock() @@ -229,6 +224,30 @@ func (interp *Interpreter) initScopePkg(pkgID string) *scope { } sc = interp.scopes[pkgID] sc.pkgID = pkgID + sc.pkgName = pkgName interp.mutex.Unlock() return sc } + +// Globals returns a map of global variables and constants in the main package. +func (interp *Interpreter) Globals() map[string]reflect.Value { + syms := map[string]reflect.Value{} + interp.mutex.RLock() + defer interp.mutex.RUnlock() + + v, ok := interp.srcPkg["main"] + if !ok { + return syms + } + + for n, s := range v { + switch s.kind { + case constSym: + syms[n] = s.rval + case varSym: + syms[n] = interp.frame.data[s.index] + } + } + + return syms +} diff --git a/vendor/github.com/traefik/yaegi/interp/src.go b/vendor/github.com/traefik/yaegi/interp/src.go index 3951d14..f7ccfad 100644 --- a/vendor/github.com/traefik/yaegi/interp/src.go +++ b/vendor/github.com/traefik/yaegi/interp/src.go @@ -2,7 +2,7 @@ package interp import ( "fmt" - "io/ioutil" + "io/fs" "os" "path/filepath" "strings" @@ -48,7 +48,7 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s } interp.rdir[importPath] = true - files, err := ioutil.ReadDir(dir) + files, err := fs.ReadDir(interp.opt.filesystem, dir) if err != nil { return "", err } @@ -69,12 +69,20 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s name = filepath.Join(dir, name) var buf []byte - if buf, err = ioutil.ReadFile(name); err != nil { + if buf, err = fs.ReadFile(interp.opt.filesystem, name); err != nil { return "", err } + n, err := interp.parse(string(buf), name, false) + if err != nil { + return "", err + } + if n == nil { + continue + } + var pname string - if pname, root, err = interp.ast(string(buf), name, false); err != nil { + if pname, root, err = interp.ast(n); err != nil { return "", err } if root == nil { @@ -97,7 +105,7 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s subRPath := effectivePkg(rPath, importPath) var list []*node - list, err = interp.gta(root, subRPath, importPath) + list, err = interp.gta(root, subRPath, importPath, pkgName) if err != nil { return "", err } @@ -106,7 +114,7 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s // Revisit incomplete nodes where GTA could not complete. for _, nodes := range revisit { - if err = interp.gtaRetry(nodes, importPath); err != nil { + if err = interp.gtaRetry(nodes, importPath, pkgName); err != nil { return "", err } } @@ -114,7 +122,7 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s // Generate control flow graphs. for _, root := range rootNodes { var nodes []*node - if nodes, err = interp.cfg(root, importPath); err != nil { + if nodes, err = interp.cfg(root, nil, importPath, pkgName); err != nil { return "", err } initNodes = append(initNodes, nodes...) @@ -124,6 +132,10 @@ func (interp *Interpreter) importSrc(rPath, importPath string, skipTest bool) (s // the global symbols in the package scope. interp.mutex.Lock() gs := interp.scopes[importPath] + if gs == nil { + // A nil scope means that no even an empty package is created from source. + return "", fmt.Errorf("no Go files in %s", dir) + } interp.srcPkg[importPath] = gs.sym interp.pkgNames[importPath] = pkgName @@ -185,13 +197,13 @@ func (interp *Interpreter) pkgDir(goPath string, root, importPath string) (strin rPath := filepath.Join(root, "vendor") dir := filepath.Join(goPath, "src", rPath, importPath) - if _, err := os.Stat(dir); err == nil { + if _, err := fs.Stat(interp.opt.filesystem, dir); err == nil { return dir, rPath, nil // found! } dir = filepath.Join(goPath, "src", effectivePkg(root, importPath)) - if _, err := os.Stat(dir); err == nil { + if _, err := fs.Stat(interp.opt.filesystem, dir); err == nil { return dir, root, nil // found! } @@ -203,7 +215,7 @@ func (interp *Interpreter) pkgDir(goPath string, root, importPath string) (strin } rootPath := filepath.Join(goPath, "src", root) - prevRoot, err := previousRoot(rootPath, root) + prevRoot, err := previousRoot(interp.opt.filesystem, rootPath, root) if err != nil { return "", "", err } @@ -214,7 +226,7 @@ func (interp *Interpreter) pkgDir(goPath string, root, importPath string) (strin const vendor = "vendor" // Find the previous source root (vendor > vendor > ... > GOPATH). -func previousRoot(rootPath, root string) (string, error) { +func previousRoot(filesystem fs.FS, rootPath, root string) (string, error) { rootPath = filepath.Clean(rootPath) parent, final := filepath.Split(rootPath) parent = filepath.Clean(parent) @@ -227,7 +239,7 @@ func previousRoot(rootPath, root string) (string, error) { // look for the closest vendor in one of our direct ancestors, as it takes priority. var vendored string for { - fi, err := os.Lstat(filepath.Join(parent, vendor)) + fi, err := fs.Stat(filesystem, filepath.Join(parent, vendor)) if err == nil && fi.IsDir() { vendored = strings.TrimPrefix(strings.TrimPrefix(parent, prefix), string(filepath.Separator)) break @@ -303,7 +315,7 @@ func effectivePkg(root, path string) string { } // isPathRelative returns true if path starts with "./" or "../". +// It is intended for use on import paths, where "/" is always the directory separator. func isPathRelative(s string) bool { - p := "." + string(filepath.Separator) - return strings.HasPrefix(s, p) || strings.HasPrefix(s, "."+p) + return strings.HasPrefix(s, "./") || strings.HasPrefix(s, "../") } diff --git a/vendor/github.com/traefik/yaegi/interp/type.go b/vendor/github.com/traefik/yaegi/interp/type.go index 0861df8..9cc7191 100644 --- a/vendor/github.com/traefik/yaegi/interp/type.go +++ b/vendor/github.com/traefik/yaegi/interp/type.go @@ -6,7 +6,9 @@ import ( "path/filepath" "reflect" "strconv" - "sync" + "strings" + + "github.com/traefik/yaegi/internal/unsafe2" ) // tcat defines interpreter type categories. @@ -24,12 +26,15 @@ const ( chanT chanSendT chanRecvT + comparableT complex64T complex128T + constraintT errorT float32T float64T funcT + genericT interfaceT intT int8T @@ -38,6 +43,7 @@ const ( int64T mapT ptrT + sliceT srcPkgT stringT structT @@ -61,8 +67,10 @@ var cats = [...]string{ boolT: "boolT", builtinT: "builtinT", chanT: "chanT", + comparableT: "comparableT", complex64T: "complex64T", complex128T: "complex128T", + constraintT: "constraintT", errorT: "errorT", float32T: "float32", float64T: "float64T", @@ -74,7 +82,9 @@ var cats = [...]string{ int32T: "int32T", int64T: "int64T", mapT: "mapT", + genericT: "genericT", ptrT: "ptrT", + sliceT: "sliceT", srcPkgT: "srcPkgT", stringT: "stringT", structT: "structT", @@ -105,152 +115,406 @@ type structField struct { // itype defines the internal representation of types in the interpreter. type itype struct { - mu *sync.Mutex - cat tcat // Type category - field []structField // Array of struct fields if structT or interfaceT - key *itype // Type of key element if MapT or nil - val *itype // Type of value element if chanT, chanSendT, chanRecvT, mapT, ptrT, aliasT, arrayT or variadicT - recv *itype // Receiver type for funcT or nil - arg []*itype // Argument types if funcT or nil - ret []*itype // Return types if funcT or nil - method []*node // Associated methods or nil - name string // name of type within its package for a defined type - path string // for a defined type, the package import path - size int // Size of array if ArrayT - rtype reflect.Type // Reflection type if ValueT, or nil - incomplete bool // true if type must be parsed again (out of order declarations) - recursive bool // true if the type has an element which refer to itself - untyped bool // true for a literal value (string or number) - sizedef bool // true if array size is computed from type definition - isBinMethod bool // true if the type refers to a bin method function - node *node // root AST node of type definition - scope *scope // type declaration scope (in case of re-parse incomplete type) -} - -func untypedBool() *itype { return &itype{cat: boolT, name: "bool", untyped: true} } -func untypedString() *itype { return &itype{cat: stringT, name: "string", untyped: true} } -func untypedRune() *itype { return &itype{cat: int32T, name: "int32", untyped: true} } -func untypedInt() *itype { return &itype{cat: intT, name: "int", untyped: true} } -func untypedFloat() *itype { return &itype{cat: float64T, name: "float64", untyped: true} } -func untypedComplex() *itype { return &itype{cat: complex128T, name: "complex128", untyped: true} } + cat tcat // Type category + field []structField // Array of struct fields if structT or interfaceT + key *itype // Type of key element if MapT or nil + val *itype // Type of value element if chanT, chanSendT, chanRecvT, mapT, ptrT, aliasT, arrayT, sliceT, variadicT or genericT + recv *itype // Receiver type for funcT or nil + arg []*itype // Argument types if funcT or nil + ret []*itype // Return types if funcT or nil + ptr *itype // Pointer to this type. Might be nil + method []*node // Associated methods or nil + constraint []*itype // For interfaceT: list of types part of interface set + ulconstraint []*itype // For interfaceT: list of underlying types part of interface set + name string // name of type within its package for a defined type + path string // for a defined type, the package import path + length int // length of array if ArrayT + rtype reflect.Type // Reflection type if ValueT, or nil + node *node // root AST node of type definition + scope *scope // type declaration scope (in case of re-parse incomplete type) + str string // String representation of the type + incomplete bool // true if type must be parsed again (out of order declarations) + untyped bool // true for a literal value (string or number) + isBinMethod bool // true if the type refers to a bin method function +} + +type generic struct{} + +func untypedBool(n *node) *itype { + return &itype{cat: boolT, name: "bool", untyped: true, str: "untyped bool", node: n} +} + +func untypedString(n *node) *itype { + return &itype{cat: stringT, name: "string", untyped: true, str: "untyped string", node: n} +} + +func untypedRune(n *node) *itype { + return &itype{cat: int32T, name: "int32", untyped: true, str: "untyped rune", node: n} +} + +func untypedInt(n *node) *itype { + return &itype{cat: intT, name: "int", untyped: true, str: "untyped int", node: n} +} + +func untypedFloat(n *node) *itype { + return &itype{cat: float64T, name: "float64", untyped: true, str: "untyped float", node: n} +} + +func untypedComplex(n *node) *itype { + return &itype{cat: complex128T, name: "complex128", untyped: true, str: "untyped complex", node: n} +} + +func errorMethodType(sc *scope) *itype { + return &itype{cat: funcT, ret: []*itype{sc.getType("string")}, str: "func() string"} +} + +type itypeOption func(*itype) + +func isBinMethod() itypeOption { + return func(t *itype) { + t.isBinMethod = true + } +} + +func withRecv(typ *itype) itypeOption { + return func(t *itype) { + t.recv = typ + } +} + +func withNode(n *node) itypeOption { + return func(t *itype) { + t.node = n + } +} + +func withScope(sc *scope) itypeOption { + return func(t *itype) { + t.scope = sc + } +} + +func withUntyped(b bool) itypeOption { + return func(t *itype) { + t.untyped = b + } +} + +// valueTOf returns a valueT itype. +func valueTOf(rtype reflect.Type, opts ...itypeOption) *itype { + t := &itype{cat: valueT, rtype: rtype, str: rtype.String()} + for _, opt := range opts { + opt(t) + } + if t.untyped { + t.str = "untyped " + t.str + } + return t +} + +// wrapperValueTOf returns a valueT itype wrapping an itype. +func wrapperValueTOf(rtype reflect.Type, val *itype, opts ...itypeOption) *itype { + t := &itype{cat: valueT, rtype: rtype, val: val, str: rtype.String()} + for _, opt := range opts { + opt(t) + } + return t +} + +func variadicOf(val *itype, opts ...itypeOption) *itype { + t := &itype{cat: variadicT, val: val, str: "..." + val.str} + for _, opt := range opts { + opt(t) + } + return t +} + +// ptrOf returns a pointer to t. +func ptrOf(val *itype, opts ...itypeOption) *itype { + if val.ptr != nil { + return val.ptr + } + t := &itype{cat: ptrT, val: val, str: "*" + val.str} + for _, opt := range opts { + opt(t) + } + val.ptr = t + return t +} + +// namedOf returns a named type of val. +func namedOf(val *itype, path, name string, opts ...itypeOption) *itype { + str := name + if path != "" { + str = path + "." + name + } + t := &itype{cat: aliasT, val: val, path: path, name: name, str: str} + for _, opt := range opts { + opt(t) + } + return t +} + +// funcOf returns a function type with the given args and returns. +func funcOf(args []*itype, ret []*itype, opts ...itypeOption) *itype { + b := []byte{} + b = append(b, "func("...) + b = append(b, paramsTypeString(args)...) + b = append(b, ')') + if len(ret) != 0 { + b = append(b, ' ') + if len(ret) > 1 { + b = append(b, '(') + } + b = append(b, paramsTypeString(ret)...) + if len(ret) > 1 { + b = append(b, ')') + } + } + + t := &itype{cat: funcT, arg: args, ret: ret, str: string(b)} + for _, opt := range opts { + opt(t) + } + return t +} + +type chanDir uint8 + +const ( + chanSendRecv chanDir = iota + chanSend + chanRecv +) + +// chanOf returns a channel of the underlying type val. +func chanOf(val *itype, dir chanDir, opts ...itypeOption) *itype { + cat := chanT + str := "chan " + switch dir { + case chanSend: + cat = chanSendT + str = "chan<- " + case chanRecv: + cat = chanRecvT + str = "<-chan " + } + t := &itype{cat: cat, val: val, str: str + val.str} + for _, opt := range opts { + opt(t) + } + return t +} + +// arrayOf returns am array type of the underlying val with the given length. +func arrayOf(val *itype, l int, opts ...itypeOption) *itype { + lstr := strconv.Itoa(l) + t := &itype{cat: arrayT, val: val, length: l, str: "[" + lstr + "]" + val.str} + for _, opt := range opts { + opt(t) + } + return t +} + +// sliceOf returns a slice type of the underlying val. +func sliceOf(val *itype, opts ...itypeOption) *itype { + t := &itype{cat: sliceT, val: val, str: "[]" + val.str} + for _, opt := range opts { + opt(t) + } + return t +} + +// mapOf returns a map type of the underlying key and val. +func mapOf(key, val *itype, opts ...itypeOption) *itype { + t := &itype{cat: mapT, key: key, val: val, str: "map[" + key.str + "]" + val.str} + for _, opt := range opts { + opt(t) + } + return t +} + +// interfaceOf returns an interface type with the given fields. +func interfaceOf(t *itype, fields []structField, constraint, ulconstraint []*itype, opts ...itypeOption) *itype { + str := "interface{}" + if len(fields) > 0 { + str = "interface { " + methodsTypeString(fields) + "}" + } + if t == nil { + t = &itype{} + } + t.cat = interfaceT + t.field = fields + t.constraint = constraint + t.ulconstraint = ulconstraint + t.str = str + for _, opt := range opts { + opt(t) + } + return t +} + +// structOf returns a struct type with the given fields. +func structOf(t *itype, fields []structField, opts ...itypeOption) *itype { + str := "struct {}" + if len(fields) > 0 { + str = "struct { " + fieldsTypeString(fields) + "}" + } + if t == nil { + t = &itype{} + } + t.cat = structT + t.field = fields + t.str = str + for _, opt := range opts { + opt(t) + } + return t +} + +// genericOf returns a generic type. +func genericOf(val *itype, name string, opts ...itypeOption) *itype { + t := &itype{cat: genericT, name: name, str: name, val: val} + for _, opt := range opts { + opt(t) + } + return t +} + +// seenNode determines if a node has been seen. +// +// seenNode treats the slice of nodes as the path traveled down a node +// tree. +func seenNode(ns []*node, n *node) bool { + for _, nn := range ns { + if nn == n { + return true + } + } + return false +} // nodeType returns a type definition for the corresponding AST subtree. func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { + return nodeType2(interp, sc, n, nil) +} + +func nodeType2(interp *Interpreter, sc *scope, n *node, seen []*node) (t *itype, err error) { if n.typ != nil && !n.typ.incomplete { - if n.kind == sliceExpr { - n.typ.sizedef = false - } return n.typ, nil } - - t := &itype{node: n, scope: sc} - - if n.anc.kind == typeSpec { - name := n.anc.child[0].ident - if sym := sc.sym[name]; sym != nil { - // recover previously declared methods - t.method = sym.typ.method - t.path = sym.typ.path - t.name = name + if sname := typeName(n); sname != "" { + sym, _, found := sc.lookup(sname) + if found && sym.kind == typeSym && sym.typ != nil { + if sym.typ.isComplete() { + return sym.typ, nil + } + if seenNode(seen, n) { + // We have seen this node in our tree, so it must be recursive. + sym.typ.incomplete = false + return sym.typ, nil + } } } + seen = append(seen, n) + defer func() { seen = seen[:len(seen)-1] }() - var err error switch n.kind { case addressExpr, starExpr: - t.cat = ptrT - if t.val, err = nodeType(interp, sc, n.child[0]); err != nil { + val, err := nodeType2(interp, sc, n.child[0], seen) + if err != nil { return nil, err } - t.incomplete = t.val.incomplete + t = ptrOf(val, withNode(n), withScope(sc)) + t.incomplete = val.incomplete case arrayType: - t.cat = arrayT c0 := n.child[0] if len(n.child) == 1 { - // Array size is not defined. - if t.val, err = nodeType(interp, sc, c0); err != nil { + val, err := nodeType2(interp, sc, c0, seen) + if err != nil { return nil, err } - t.incomplete = t.val.incomplete + t = sliceOf(val, withNode(n), withScope(sc)) + t.incomplete = val.incomplete break } // Array size is defined. + var ( + length int + incomplete bool + ) switch v := c0.rval; { case v.IsValid(): // Size if defined by a constant litteral value. if isConstantValue(v.Type()) { c := v.Interface().(constant.Value) - t.size = constToInt(c) + length = constToInt(c) } else { - t.size = int(v.Int()) + length = int(v.Int()) } case c0.kind == ellipsisExpr: // [...]T expression, get size from the length of composite array. - t.size = arrayTypeLen(n.anc) + length, err = arrayTypeLen(n.anc, sc) + if err != nil { + incomplete = true + } case c0.kind == identExpr: sym, _, ok := sc.lookup(c0.ident) if !ok { - t.incomplete = true + incomplete = true break } // Size is defined by a symbol which must be a constant integer. if sym.kind != constSym { return nil, c0.cfgErrorf("non-constant array bound %q", c0.ident) } - if sym.typ == nil || sym.typ.cat != intT || !sym.rval.IsValid() { - t.incomplete = true + if sym.typ == nil || !isInt(sym.typ.TypeOf()) || !sym.rval.IsValid() { + incomplete = true break } - if v, ok := sym.rval.Interface().(int); ok { - t.size = v - break - } - if c, ok := sym.rval.Interface().(constant.Value); ok { - t.size = constToInt(c) - break - } - t.incomplete = true + length = int(vInt(sym.rval)) default: // Size is defined by a numeric constant expression. - if _, err = interp.cfg(c0, sc.pkgID); err != nil { + if _, err = interp.cfg(c0, sc, sc.pkgID, sc.pkgName); err != nil { return nil, err } v, ok := c0.rval.Interface().(constant.Value) if !ok { - t.incomplete = true + incomplete = true break } - t.size = constToInt(v) + length = constToInt(v) } - if t.val, err = nodeType(interp, sc, n.child[1]); err != nil { + val, err := nodeType2(interp, sc, n.child[1], seen) + if err != nil { return nil, err } - t.sizedef = true - t.incomplete = t.incomplete || t.val.incomplete + t = arrayOf(val, length, withNode(n), withScope(sc)) + t.incomplete = incomplete || val.incomplete case basicLit: switch v := n.rval.Interface().(type) { case bool: n.rval = reflect.ValueOf(constant.MakeBool(v)) - t = untypedBool() + t = untypedBool(n) case rune: // It is impossible to work out rune const literals in AST // with the correct type so we must make the const type here. n.rval = reflect.ValueOf(constant.MakeInt64(int64(v))) - t = untypedRune() + t = untypedRune(n) case constant.Value: switch v.Kind() { case constant.Bool: - t = untypedBool() + t = untypedBool(n) case constant.String: - t = untypedString() + t = untypedString(n) case constant.Int: - t = untypedInt() + t = untypedInt(n) case constant.Float: - t = untypedFloat() + t = untypedFloat(n) case constant.Complex: - t = untypedComplex() + t = untypedComplex(n) default: err = n.cfgErrorf("missing support for type %v", n.rval) } @@ -259,72 +523,84 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { } case unaryExpr: - t, err = nodeType(interp, sc, n.child[0]) + // In interfaceType, we process an underlying type constraint definition. + if isInInterfaceType(n) { + t1, err := nodeType2(interp, sc, n.child[0], seen) + if err != nil { + return nil, err + } + t = &itype{cat: constraintT, ulconstraint: []*itype{t1}} + break + } + t, err = nodeType2(interp, sc, n.child[0], seen) case binaryExpr: + // In interfaceType, we process a type constraint union definition. + if isInInterfaceType(n) { + t = &itype{cat: constraintT, constraint: []*itype{}, ulconstraint: []*itype{}} + for _, c := range n.child { + t1, err := nodeType2(interp, sc, c, seen) + if err != nil { + return nil, err + } + switch t1.cat { + case constraintT: + t.constraint = append(t.constraint, t1.constraint...) + t.ulconstraint = append(t.ulconstraint, t1.ulconstraint...) + default: + t.constraint = append(t.constraint, t1) + } + } + break + } // Get type of first operand. - if t, err = nodeType(interp, sc, n.child[0]); err != nil { + if t, err = nodeType2(interp, sc, n.child[0], seen); err != nil { return nil, err } // For operators other than shift, get the type from the 2nd operand if the first is untyped. if t.untyped && !isShiftNode(n) { var t1 *itype - t1, err = nodeType(interp, sc, n.child[1]) + t1, err = nodeType2(interp, sc, n.child[1], seen) if !(t1.untyped && isInt(t1.TypeOf()) && isFloat(t.TypeOf())) { t = t1 } } - // Because an empty interface concrete type "mutates" as different values are - // assigned to it, we need to make a new itype from scratch everytime a new - // assignment is made, and not let different nodes (of the same variable) share the - // same itype. Otherwise they would overwrite each other. - if n.anc.kind == assignStmt && isInterface(n.anc.child[0].typ) && len(n.anc.child[0].typ.field) == 0 { - // TODO(mpl): do the indexes properly for multiple assignments on the same line. - // Also, maybe we should use nodeType to figure out dt.cat? but isn't it always - // gonna be an interfaceT anyway? - dt := new(itype) - dt.cat = interfaceT - val := new(itype) - val.cat = t.cat - dt.val = val - // TODO(mpl): do the indexes properly for multiple assignments on the same line. - // Also, maybe we should use nodeType to figure out dt.cat? but isn't it always - // gonna be an interfaceT anyway? - n.anc.child[0].typ = dt - // TODO(mpl): not sure yet whether we should do that last step. It doesn't seem - // to change anything either way though. - // t = dt - break - } - // If the node is to be assigned or returned, the node type is the destination type. dt := t switch a := n.anc; { + case a.kind == assignStmt && isEmptyInterface(a.child[0].typ): + // Because an empty interface concrete type "mutates" as different values are + // assigned to it, we need to make a new itype from scratch everytime a new + // assignment is made, and not let different nodes (of the same variable) share the + // same itype. Otherwise they would overwrite each other. + a.child[0].typ = &itype{cat: interfaceT, val: dt, str: "interface{}"} + case a.kind == defineStmt && len(a.child) > a.nleft+a.nright: - if dt, err = nodeType(interp, sc, a.child[a.nleft]); err != nil { + if dt, err = nodeType2(interp, sc, a.child[a.nleft], seen); err != nil { return nil, err } + case a.kind == returnStmt: dt = sc.def.typ.ret[childPos(n)] } - if isInterface(dt) { + + if isInterfaceSrc(dt) { dt.val = t } t = dt case callExpr: - if interp.isBuiltinCall(n) { + if isBuiltinCall(n, sc) { // Builtin types are special and may depend from their input arguments. - t.cat = builtinT switch n.child[0].ident { case bltnComplex: var nt0, nt1 *itype - if nt0, err = nodeType(interp, sc, n.child[1]); err != nil { + if nt0, err = nodeType2(interp, sc, n.child[1], seen); err != nil { return nil, err } - if nt1, err = nodeType(interp, sc, n.child[2]); err != nil { + if nt1, err = nodeType2(interp, sc, n.child[2], seen); err != nil { return nil, err } if nt0.incomplete || nt1.incomplete { @@ -336,7 +612,7 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { case isFloat64(t0) && isFloat64(t1): t = sc.getType("complex128") case nt0.untyped && isNumber(t0) && nt1.untyped && isNumber(t1): - t = untypedComplex() + t = untypedComplex(n) case nt0.untyped && isFloat32(t1) || nt1.untyped && isFloat32(t0): t = sc.getType("complex64") case nt0.untyped && isFloat64(t1) || nt1.untyped && isFloat64(t0): @@ -345,21 +621,21 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { err = n.cfgErrorf("invalid types %s and %s", t0.Kind(), t1.Kind()) } if nt0.untyped && nt1.untyped { - t.untyped = true + t = untypedComplex(n) } } case bltnReal, bltnImag: - if t, err = nodeType(interp, sc, n.child[1]); err != nil { + if t, err = nodeType2(interp, sc, n.child[1], seen); err != nil { return nil, err } if !t.incomplete { switch k := t.TypeOf().Kind(); { + case t.untyped && isNumber(t.TypeOf()): + t = untypedFloat(n) case k == reflect.Complex64: t = sc.getType("float32") case k == reflect.Complex128: t = sc.getType("float64") - case t.untyped && isNumber(t.TypeOf()): - t = &itype{cat: valueT, rtype: floatType, untyped: true, scope: sc} default: err = n.cfgErrorf("invalid complex type %s", k) } @@ -367,24 +643,28 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { case bltnCap, bltnCopy, bltnLen: t = sc.getType("int") case bltnAppend, bltnMake: - t, err = nodeType(interp, sc, n.child[1]) + t, err = nodeType2(interp, sc, n.child[1], seen) case bltnNew: - t, err = nodeType(interp, sc, n.child[1]) - t = &itype{cat: ptrT, val: t, incomplete: t.incomplete, scope: sc} + t, err = nodeType2(interp, sc, n.child[1], seen) + incomplete := t.incomplete + t = ptrOf(t, withScope(sc)) + t.incomplete = incomplete case bltnRecover: t = sc.getType("interface{}") + default: + t = &itype{cat: builtinT} } if err != nil { return nil, err } } else { - if t, err = nodeType(interp, sc, n.child[0]); err != nil { + if t, err = nodeType2(interp, sc, n.child[0], seen); err != nil || t == nil { return nil, err } switch t.cat { case valueT: if rt := t.rtype; rt.Kind() == reflect.Func && rt.NumOut() == 1 { - t = &itype{cat: valueT, rtype: rt.Out(0), scope: sc} + t = valueTOf(rt.Out(0), withScope(sc)) } default: if len(t.ret) == 1 { @@ -394,71 +674,85 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { } case compositeLitExpr: - t, err = nodeType(interp, sc, n.child[0]) - - case chanType: - t.cat = chanT - if t.val, err = nodeType(interp, sc, n.child[0]); err != nil { + t, err = nodeType2(interp, sc, n.child[0], seen) + + case chanType, chanTypeRecv, chanTypeSend: + dir := chanSendRecv + switch n.kind { + case chanTypeRecv: + dir = chanRecv + case chanTypeSend: + dir = chanSend + } + val, err := nodeType2(interp, sc, n.child[0], seen) + if err != nil { return nil, err } - t.incomplete = t.val.incomplete - - case chanTypeRecv: - t.cat = chanRecvT - if t.val, err = nodeType(interp, sc, n.child[0]); err != nil { - return nil, err - } - t.incomplete = t.val.incomplete - - case chanTypeSend: - t.cat = chanSendT - if t.val, err = nodeType(interp, sc, n.child[0]); err != nil { - return nil, err - } - t.incomplete = t.val.incomplete + t = chanOf(val, dir, withNode(n), withScope(sc)) + t.incomplete = val.incomplete case ellipsisExpr: - t.cat = variadicT - if t.val, err = nodeType(interp, sc, n.child[0]); err != nil { + val, err := nodeType2(interp, sc, n.child[0], seen) + if err != nil { return nil, err } + t = variadicOf(val, withNode(n), withScope(sc)) t.incomplete = t.val.incomplete case funcLit: - t, err = nodeType(interp, sc, n.child[2]) + t, err = nodeType2(interp, sc, n.child[2], seen) case funcType: - t.cat = funcT - // Handle input parameters + var incomplete bool + + // Handle type parameters. for _, arg := range n.child[0].child { cl := len(arg.child) - 1 - typ, err := nodeType(interp, sc, arg.child[cl]) + typ, err := nodeType2(interp, sc, arg.child[cl], seen) if err != nil { return nil, err } - t.arg = append(t.arg, typ) + for _, c := range arg.child[:cl] { + sc.sym[c.ident] = &symbol{index: -1, kind: varTypeSym, typ: typ} + } + incomplete = incomplete || typ.incomplete + } + + // Handle input parameters. + args := make([]*itype, 0, len(n.child[1].child)) + for _, arg := range n.child[1].child { + cl := len(arg.child) - 1 + typ, err := nodeType2(interp, sc, arg.child[cl], seen) + if err != nil { + return nil, err + } + args = append(args, typ) + // Several arguments may be factorized on the same field type. for i := 1; i < cl; i++ { - // Several arguments may be factorized on the same field type - t.arg = append(t.arg, typ) + args = append(args, typ) } - t.incomplete = t.incomplete || typ.incomplete + incomplete = incomplete || typ.incomplete } - if len(n.child) == 2 { - // Handle returned values - for _, ret := range n.child[1].child { + + // Handle returned values. + var rets []*itype + if len(n.child) == 3 { + for _, ret := range n.child[2].child { cl := len(ret.child) - 1 - typ, err := nodeType(interp, sc, ret.child[cl]) + typ, err := nodeType2(interp, sc, ret.child[cl], seen) if err != nil { return nil, err } - t.ret = append(t.ret, typ) + rets = append(rets, typ) + // Several arguments may be factorized on the same field type. for i := 1; i < cl; i++ { - // Several arguments may be factorized on the same field type - t.ret = append(t.ret, typ) + rets = append(rets, typ) } - t.incomplete = t.incomplete || typ.incomplete + incomplete = incomplete || typ.incomplete } } + t = funcOf(args, rets, withNode(n), withScope(sc)) + t.incomplete = incomplete case identExpr: sym, _, found := sc.lookup(n.ident) @@ -468,18 +762,22 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { ident := filepath.Join(n.ident, baseName) sym, _, found = sc.lookup(ident) if !found { - t.incomplete = true + t = &itype{name: n.ident, path: sc.pkgName, node: n, incomplete: true, scope: sc} sc.sym[n.ident] = &symbol{kind: typeSym, typ: t} break } } - t = sym.typ + if sym.kind == varTypeSym { + t = genericOf(sym.typ, n.ident, withNode(n), withScope(sc)) + } else { + t = sym.typ + } if t.incomplete && t.cat == aliasT && t.val != nil && t.val.cat != nilT { t.incomplete = false } if t.incomplete && t.node != n { m := t.method - if t, err = nodeType(interp, sc, t.node); err != nil { + if t, err = nodeType2(interp, sc, t.node, seen); err != nil { return nil, err } t.method = m @@ -491,7 +789,7 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { case indexExpr: var lt *itype - if lt, err = nodeType(interp, sc, n.child[0]); err != nil { + if lt, err = nodeType2(interp, sc, n.child[0], seen); err != nil { return nil, err } if lt.incomplete { @@ -499,83 +797,142 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { break } switch lt.cat { - case arrayT, mapT: + case arrayT, mapT, sliceT, variadicT: t = lt.val + case genericT: + t1, err := nodeType2(interp, sc, n.child[1], seen) + if err != nil { + return nil, err + } + if t1.cat == genericT || t1.incomplete { + t = lt + break + } + name := lt.id() + "[" + t1.id() + "]" + if sym, _, found := sc.lookup(name); found { + t = sym.typ + break + } + // A generic type is being instantiated. Generate it. + g, err := genAST(sc, lt.node.anc, []*node{t1.node}) + if err != nil { + return nil, err + } + t, err = nodeType2(interp, sc, g.lastChild(), seen) + if err != nil { + return nil, err + } + sc.sym[name] = &symbol{index: -1, kind: typeSym, typ: t, node: g} + + // Instantiate type methods (if any). + var pt *itype + if len(lt.method) > 0 { + pt = ptrOf(t, withNode(g), withScope(sc)) + } + for _, nod := range lt.method { + gm, err := genAST(sc, nod, []*node{t1.node}) + if err != nil { + return nil, err + } + if gm.typ, err = nodeType(interp, sc, gm.child[2]); err != nil { + return nil, err + } + t.addMethod(gm) + if rtn := gm.child[0].child[0].lastChild(); rtn.kind == starExpr { + // The receiver is a pointer on a generic type. + pt.addMethod(gm) + rtn.typ = pt + } + // Compile method CFG. + if _, err = interp.cfg(gm, sc, sc.pkgID, sc.pkgName); err != nil { + return nil, err + } + // Generate closures for function body. + if err = genRun(gm); err != nil { + return nil, err + } + } } case interfaceType: - t.cat = interfaceT - var incomplete bool if sname := typeName(n); sname != "" { if sym, _, found := sc.lookup(sname); found && sym.kind == typeSym { - sym.typ = t + t = interfaceOf(sym.typ, sym.typ.field, sym.typ.constraint, sym.typ.ulconstraint, withNode(n), withScope(sc)) } } - for _, field := range n.child[0].child { - if len(field.child) == 1 { - typ, err := nodeType(interp, sc, field.child[0]) - if err != nil { - return nil, err + var incomplete bool + fields := []structField{} + constraint := []*itype{} + ulconstraint := []*itype{} + for _, c := range n.child[0].child { + c0 := c.child[0] + if len(c.child) == 1 { + if c0.ident == "error" { + // Unwrap error interface inplace rather than embedding it, because + // "error" is lower case which may cause problems with reflect for method lookup. + typ := errorMethodType(sc) + fields = append(fields, structField{name: "Error", typ: typ}) + continue } - t.field = append(t.field, structField{name: fieldName(field.child[0]), embed: true, typ: typ}) - incomplete = incomplete || typ.incomplete - } else { - typ, err := nodeType(interp, sc, field.child[1]) + typ, err := nodeType2(interp, sc, c0, seen) if err != nil { return nil, err } - t.field = append(t.field, structField{name: field.child[0].ident, typ: typ}) incomplete = incomplete || typ.incomplete + if typ.cat == constraintT { + constraint = append(constraint, typ.constraint...) + ulconstraint = append(ulconstraint, typ.ulconstraint...) + continue + } + fields = append(fields, structField{name: fieldName(c0), embed: true, typ: typ}) + continue } + typ, err := nodeType2(interp, sc, c.child[1], seen) + if err != nil { + return nil, err + } + fields = append(fields, structField{name: c0.ident, typ: typ}) + incomplete = incomplete || typ.incomplete } + t = interfaceOf(t, fields, constraint, ulconstraint, withNode(n), withScope(sc)) t.incomplete = incomplete case landExpr, lorExpr: - t.cat = boolT + t = sc.getType("bool") case mapType: - t.cat = mapT - if t.key, err = nodeType(interp, sc, n.child[0]); err != nil { + key, err := nodeType2(interp, sc, n.child[0], seen) + if err != nil { return nil, err } - if t.val, err = nodeType(interp, sc, n.child[1]); err != nil { + val, err := nodeType2(interp, sc, n.child[1], seen) + if err != nil { return nil, err } - t.incomplete = t.key.incomplete || t.val.incomplete + t = mapOf(key, val, withNode(n), withScope(sc)) + t.incomplete = key.incomplete || val.incomplete case parenExpr: - t, err = nodeType(interp, sc, n.child[0]) + t, err = nodeType2(interp, sc, n.child[0], seen) case selectorExpr: // Resolve the left part of selector, then lookup the right part on it var lt *itype - // If we are in a list of func parameters, and we are a selector on a binPkgT, but - // one of the other parameters has the same name as the pkg name, in the list of - // symbols we would find the other parameter instead of the pkg because it comes - // first when looking up in the stack of scopes. So in that case we force the - // lookup directly in the root scope to shortcircuit that issue. - var localScope *scope - localScope = sc - if n.anc != nil && len(n.anc.child) > 1 && n.anc.child[1] == n && - // This check is weaker than what we actually want to know, i.e. whether - // n.anc.child[0] is a variable, but it seems at this point in the run we have no - // way of knowing that yet (typ is nil, so there's no typ.cat yet). - n.anc.child[0].kind == identExpr { - for { - if localScope.level == 0 { - break - } - localScope = localScope.anc - } + // Lookup the package symbol first if we are in a field expression as + // a previous parameter has the same name as the package, we need to + // prioritize the package type. + if n.anc.kind == fieldExpr { + lt = findPackageType(interp, sc, n.child[0]) } - - if lt, err = nodeType(interp, localScope, n.child[0]); err != nil { - return nil, err + if lt == nil { + // No package was found or we are not in a field expression, we are looking for a variable. + if lt, err = nodeType2(interp, sc, n.child[0], seen); err != nil { + return nil, err + } } if lt.incomplete { - t.incomplete = true break } name := n.child[1].ident @@ -583,12 +940,12 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { case binPkgT: pkg := interp.binPkg[lt.path] if v, ok := pkg[name]; ok { - t.cat = valueT - t.rtype = v.Type() + rtype := v.Type() if isBinType(v) { // A bin type is encoded as a pointer on a typed nil value. - t.rtype = t.rtype.Elem() + rtype = rtype.Elem() } + t = valueTOf(rtype, withNode(n), withScope(sc)) } else { err = n.cfgErrorf("undefined selector %s.%s", lt.path, name) } @@ -601,55 +958,71 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { } default: if m, _ := lt.lookupMethod(name); m != nil { - t, err = nodeType(interp, sc, m.child[2]) + t, err = nodeType2(interp, sc, m.child[2], seen) } else if bm, _, _, ok := lt.lookupBinMethod(name); ok { - t = &itype{cat: valueT, rtype: bm.Type, recv: lt, isBinMethod: true, scope: sc} + t = valueTOf(bm.Type, isBinMethod(), withRecv(lt), withScope(sc)) } else if ti := lt.lookupField(name); len(ti) > 0 { t = lt.fieldSeq(ti) } else if bs, _, ok := lt.lookupBinField(name); ok { - t = &itype{cat: valueT, rtype: bs.Type, scope: sc} + t = valueTOf(bs.Type, withScope(sc)) } else { err = lt.node.cfgErrorf("undefined selector %s", name) } } case sliceExpr: - t, err = nodeType(interp, sc, n.child[0]) + t, err = nodeType2(interp, sc, n.child[0], seen) + if err != nil { + return nil, err + } + + if t.cat == valueT { + switch t.rtype.Kind() { + case reflect.Array, reflect.Ptr: + t = valueTOf(reflect.SliceOf(t.rtype.Elem()), withScope(sc)) + } + break + } if t.cat == ptrT { t = t.val } - if err == nil && t.size != 0 { - t1 := *t - t1.size = 0 - t1.sizedef = false - t1.rtype = nil - t = &t1 + if t.cat == arrayT { + incomplete := t.incomplete + t = sliceOf(t.val, withNode(n), withScope(sc)) + t.incomplete = incomplete } case structType: - t.cat = structT - var incomplete bool - if sname := typeName(n); sname != "" { - if sym, _, found := sc.lookup(sname); found && sym.kind == typeSym { - sym.typ = t + var sym *symbol + var found bool + sname := structName(n) + if sname != "" { + sym, _, found = sc.lookup(sname) + if found && sym.kind == typeSym { + t = structOf(sym.typ, sym.typ.field, withNode(n), withScope(sc)) + } else { + t = structOf(nil, nil, withNode(n), withScope(sc)) + sc.sym[sname] = &symbol{index: -1, kind: typeSym, typ: t, node: n} } } + var incomplete bool + fields := make([]structField, 0, len(n.child[0].child)) for _, c := range n.child[0].child { switch { case len(c.child) == 1: - typ, err := nodeType(interp, sc, c.child[0]) + typ, err := nodeType2(interp, sc, c.child[0], seen) if err != nil { return nil, err } - t.field = append(t.field, structField{name: fieldName(c.child[0]), embed: true, typ: typ}) + fields = append(fields, structField{name: fieldName(c.child[0]), embed: true, typ: typ}) incomplete = incomplete || typ.incomplete case len(c.child) == 2 && c.child[1].kind == basicLit: tag := vString(c.child[1].rval) - typ, err := nodeType(interp, sc, c.child[0]) + typ, err := nodeType2(interp, sc, c.child[0], seen) if err != nil { return nil, err } - t.field = append(t.field, structField{name: fieldName(c.child[0]), embed: true, typ: typ, tag: tag}) + fields = append(fields, structField{name: fieldName(c.child[0]), embed: true, typ: typ, tag: tag}) incomplete = incomplete || typ.incomplete default: var tag string @@ -658,39 +1031,91 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) { tag = vString(c.lastChild().rval) l-- } - typ, err := nodeType(interp, sc, c.child[l-1]) + typ, err := nodeType2(interp, sc, c.child[l-1], seen) if err != nil { return nil, err } incomplete = incomplete || typ.incomplete for _, d := range c.child[:l-1] { - t.field = append(t.field, structField{name: d.ident, typ: typ, tag: tag}) + fields = append(fields, structField{name: d.ident, typ: typ, tag: tag}) } } } + t = structOf(t, fields, withNode(n), withScope(sc)) t.incomplete = incomplete + if sname != "" { + sc.sym[sname].typ = t + } default: err = n.cfgErrorf("type definition not implemented: %s", n.kind) } - if err == nil && t.cat == nilT && !t.incomplete { + if err == nil && t != nil && t.cat == nilT && !t.incomplete { err = n.cfgErrorf("use of untyped nil %s", t.name) } + // The existing symbol data needs to be recovered, but not in the + // case where we are aliasing another type. + if n.anc.kind == typeSpec && n.kind != selectorExpr && n.kind != identExpr { + name := n.anc.child[0].ident + if sym := sc.sym[name]; sym != nil { + t.path = sc.pkgName + t.name = name + } + } + + switch { + case t == nil: + case t.name != "" && t.path != "": + t.str = t.path + "." + t.name + case t.cat == nilT: + t.str = "nil" + } + return t, err } -func (interp *Interpreter) isBuiltinCall(n *node) bool { +// findPackageType searches the top level scope for a package type. +func findPackageType(interp *Interpreter, sc *scope, n *node) *itype { + // Find the root scope, the package symbols will exist there. + for { + if sc.level == 0 { + break + } + sc = sc.anc + } + + baseName := filepath.Base(interp.fset.Position(n.pos).Filename) + sym, _, found := sc.lookup(filepath.Join(n.ident, baseName)) + if !found || sym.typ == nil && sym.typ.cat != srcPkgT && sym.typ.cat != binPkgT { + return nil + } + return sym.typ +} + +func isBuiltinCall(n *node, sc *scope) bool { if n.kind != callExpr { return false } - s := interp.universe.sym[n.child[0].ident] + s := n.child[0].sym + if s == nil { + if sym, _, found := sc.lookup(n.child[0].ident); found { + s = sym + } + } return s != nil && s.kind == bltnSym } // struct name returns the name of a struct type. func typeName(n *node) string { + if n.anc.kind == typeSpec && len(n.anc.child) == 2 { + return n.anc.child[0].ident + } + return "" +} + +func structName(n *node) string { if n.anc.kind == typeSpec { return n.anc.child[0].ident } @@ -764,40 +1189,13 @@ func (t *itype) finalize() (*itype, error) { return t, err } -// ReferTo returns true if the type contains a reference to a -// full type name. It allows to assess a type recursive status. -func (t *itype) referTo(name string, seen map[*itype]bool) bool { - if t.path+"/"+t.name == name { - return true - } - if seen[t] { - return false - } - seen[t] = true - switch t.cat { - case aliasT, arrayT, chanT, chanRecvT, chanSendT, ptrT: - return t.val.referTo(name, seen) - case funcT: - for _, a := range t.arg { - if a.referTo(name, seen) { - return true - } - } - for _, a := range t.ret { - if a.referTo(name, seen) { - return true - } - } - case mapT: - return t.key.referTo(name, seen) || t.val.referTo(name, seen) - case structT, interfaceT: - for _, f := range t.field { - if f.typ.referTo(name, seen) { - return true - } +func (t *itype) addMethod(n *node) { + for _, m := range t.method { + if m == n { + return } } - return false + t.method = append(t.method, n) } func (t *itype) numIn() int { @@ -823,13 +1221,14 @@ func (t *itype) in(i int) *itype { return t.arg[i] case valueT: if t.rtype.Kind() == reflect.Func { - if t.recv != nil { + if t.recv != nil && !isInterface(t.recv) { i++ } if t.rtype.IsVariadic() && i == t.rtype.NumIn()-1 { - return &itype{cat: variadicT, val: &itype{cat: valueT, rtype: t.rtype.In(i).Elem()}} + val := valueTOf(t.rtype.In(i).Elem()) + return &itype{cat: variadicT, val: val, str: "..." + val.str} } - return &itype{cat: valueT, rtype: t.rtype.In(i)} + return valueTOf(t.rtype.In(i)) } } return nil @@ -853,7 +1252,7 @@ func (t *itype) out(i int) *itype { return t.ret[i] case valueT: if t.rtype.Kind() == reflect.Func { - return &itype{cat: valueT, rtype: t.rtype.Out(i)} + return valueTOf(t.rtype.Out(i)) } } return nil @@ -866,19 +1265,20 @@ func (t *itype) concrete() *itype { return t } -// IsRecursive returns true if type is recursive. -// Only a named struct or interface can be recursive. -func (t *itype) isRecursive() bool { - if t.name == "" { - return false +func (t *itype) underlying() *itype { + if t.cat == aliasT { + return t.val.underlying() } - switch t.cat { - case structT, interfaceT: - for _, f := range t.field { - if f.typ.referTo(t.path+"/"+t.name, map[*itype]bool{}) { - return true - } - } + return t +} + +// typeDefined returns true if type t1 is defined from type t2 or t2 from t1. +func typeDefined(t1, t2 *itype) bool { + if t1.cat == aliasT && t1.val == t2 { + return true + } + if t2.cat == aliasT && t2.val == t1 { + return true } return false } @@ -919,7 +1319,7 @@ func isComplete(t *itype, visited map[string]bool) bool { return true } fallthrough - case arrayT, chanT, chanRecvT, chanSendT, ptrT: + case arrayT, chanT, chanRecvT, chanSendT, ptrT, sliceT, variadicT: return isComplete(t.val, visited) case funcT: complete := true @@ -956,10 +1356,11 @@ func (t *itype) assignableTo(o *itype) bool { if t.equals(o) { return true } - if t.cat == aliasT && o.cat == aliasT { - // if alias types are not identical, it is not assignable. + + if t.cat == aliasT && o.cat == aliasT && (t.underlying().id() != o.underlying().id() || !typeDefined(t, o)) { return false } + if t.isNil() && o.hasNil() || o.isNil() && t.hasNil() { return true } @@ -968,6 +1369,24 @@ func (t *itype) assignableTo(o *itype) bool { return true } + if isInterface(o) && t.implements(o) { + return true + } + + if t.cat == sliceT && o.cat == sliceT { + return t.val.assignableTo(o.val) + } + + if t.isBinMethod && isFunc(o) { + // TODO (marc): check that t without receiver as first parameter is equivalent to o. + return true + } + + if t.untyped && isNumber(t.TypeOf()) && isNumber(o.TypeOf()) { + // Assignability depends on constant numeric value (overflow check), to be tested elsewhere. + return true + } + n := t.node if n == nil || !n.rval.IsValid() { return false @@ -1053,6 +1472,10 @@ func (t *itype) methods() methodSet { seen[typ] = true switch typ.cat { + case aliasT: + for k, v := range getMethods(typ.val) { + res[k] = v + } case interfaceT: // Get methods from recursive analysis of interface fields. for _, f := range typ.field { @@ -1066,7 +1489,7 @@ func (t *itype) methods() methodSet { } case valueT, errorT: // Get method from corresponding reflect.Type. - for i := typ.rtype.NumMethod() - 1; i >= 0; i-- { + for i := typ.TypeOf().NumMethod() - 1; i >= 0; i-- { m := typ.rtype.Method(i) res[m.Name] = m.Type.String() } @@ -1104,67 +1527,34 @@ func (t *itype) methods() methodSet { // id returns a unique type identificator string. func (t *itype) id() (res string) { - if t.name != "" { - if t.path != "" { - return t.path + "." + t.name - } - return t.name + // Prefer the wrapped type string over the rtype string. + if t.cat == valueT && t.val != nil { + return t.val.str } - switch t.cat { - case nilT: - res = "nil" - case arrayT: - if t.size == 0 { - res = "[]" + t.val.id() - } else { - res = "[" + strconv.Itoa(t.size) + "]" + t.val.id() - } - case chanT: - res = "chan " + t.val.id() - case chanSendT: - res = "chan<- " + t.val.id() - case chanRecvT: - res = "<-chan " + t.val.id() - case funcT: - res = "func(" - for i, t := range t.arg { - if i > 0 { - res += "," - } - res += t.id() - } - res += ")(" - for i, t := range t.ret { - if i > 0 { - res += "," - } - res += t.id() - } - res += ")" - case interfaceT: - res = "interface{" - for _, t := range t.field { - res += t.name + " " + t.typ.id() + ";" - } - res += "}" - case mapT: - res = "map[" + t.key.id() + "]" + t.val.id() - case ptrT: - res = "*" + t.val.id() - case structT: - res = "struct{" - for _, t := range t.field { - res += t.name + " " + t.typ.id() + ";" - } - res += "}" - case valueT: - res = "" - if t.rtype.PkgPath() != "" { - res += t.rtype.PkgPath() + "." - } - res += t.rtype.Name() + return t.str +} + +// fixPossibleConstType returns the input type if it not a constant value, +// otherwise, it returns the default Go type corresponding to the +// constant.Value. +func fixPossibleConstType(t reflect.Type) (r reflect.Type) { + cv, ok := reflect.New(t).Elem().Interface().(constant.Value) + if !ok { + return t + } + switch cv.Kind() { + case constant.Bool: + r = reflect.TypeOf(true) + case constant.Int: + r = reflect.TypeOf(0) + case constant.String: + r = reflect.TypeOf("") + case constant.Float: + r = reflect.TypeOf(float64(0)) + case constant.Complex: + r = reflect.TypeOf(complex128(0)) } - return res + return r } // zero instantiates and return a zero value object for the given type during execution. @@ -1176,7 +1566,7 @@ func (t *itype) zero() (v reflect.Value, err error) { case aliasT: v, err = t.val.zero() - case arrayT, ptrT, structT: + case arrayT, ptrT, structT, sliceT: v = reflect.New(t.frameType()).Elem() case valueT: @@ -1216,24 +1606,36 @@ func (t *itype) fieldSeq(seq []int) *itype { // lookupField returns a list of indices, i.e. a path to access a field in a struct object. func (t *itype) lookupField(name string) []int { - switch t.cat { - case aliasT, ptrT: - return t.val.lookupField(name) - } - if fi := t.fieldIndex(name); fi >= 0 { - return []int{fi} - } + seen := map[*itype]bool{} + var lookup func(*itype) []int - for i, f := range t.field { - switch f.typ.cat { - case ptrT, structT, interfaceT, aliasT: - if index2 := f.typ.lookupField(name); len(index2) > 0 { - return append([]int{i}, index2...) + lookup = func(typ *itype) []int { + if seen[typ] { + return nil + } + seen[typ] = true + + switch typ.cat { + case aliasT, ptrT: + return lookup(typ.val) + } + if fi := typ.fieldIndex(name); fi >= 0 { + return []int{fi} + } + + for i, f := range typ.field { + switch f.typ.cat { + case ptrT, structT, interfaceT, aliasT: + if index2 := lookup(f.typ); len(index2) > 0 { + return append([]int{i}, index2...) + } } } + + return nil } - return nil + return lookup(t) } // lookupBinField returns a structfield and a path to access an embedded binary field in a struct object. @@ -1244,10 +1646,13 @@ func (t *itype) lookupBinField(name string) (s reflect.StructField, index []int, if !isStruct(t) { return } - rt := t.rtype - if t.cat == valueT && rt.Kind() == reflect.Ptr { + rt := t.TypeOf() + for t.cat == valueT && rt.Kind() == reflect.Ptr { rt = rt.Elem() } + if rt.Kind() != reflect.Struct { + return + } s, ok = rt.FieldByName(name) if !ok { for i, f := range t.field { @@ -1278,6 +1683,13 @@ func (t *itype) methodCallType() reflect.Type { return reflect.FuncOf(it, ot, t.rtype.IsVariadic()) } +func (t *itype) resolveAlias() *itype { + for t.cat == aliasT { + t = t.val + } + return t +} + // GetMethod returns a pointer to the method definition. func (t *itype) getMethod(name string) *node { for _, m := range t.method { @@ -1291,32 +1703,68 @@ func (t *itype) getMethod(name string) *node { // LookupMethod returns a pointer to method definition associated to type t // and the list of indices to access the right struct field, in case of an embedded method. func (t *itype) lookupMethod(name string) (*node, []int) { + return t.lookupMethod2(name, nil) +} + +func (t *itype) lookupMethod2(name string, seen map[*itype]bool) (*node, []int) { + if seen == nil { + seen = map[*itype]bool{} + } + if seen[t] { + return nil, nil + } + seen[t] = true if t.cat == ptrT { - return t.val.lookupMethod(name) + return t.val.lookupMethod2(name, seen) } var index []int m := t.getMethod(name) if m == nil { for i, f := range t.field { if f.embed { - if n, index2 := f.typ.lookupMethod(name); n != nil { + if n, index2 := f.typ.lookupMethod2(name, seen); n != nil { index = append([]int{i}, index2...) return n, index } } } + if t.cat == aliasT || isInterfaceSrc(t) && t.val != nil { + return t.val.lookupMethod2(name, seen) + } } return m, index } +// methodDepth returns a depth greater or equal to 0, or -1 if no match. +func (t *itype) methodDepth(name string) int { + if m, lint := t.lookupMethod(name); m != nil { + return len(lint) + } + if _, lint, _, ok := t.lookupBinMethod(name); ok { + return len(lint) + } + return -1 +} + // LookupBinMethod returns a method and a path to access a field in a struct object (the receiver). func (t *itype) lookupBinMethod(name string) (m reflect.Method, index []int, isPtr, ok bool) { + return t.lookupBinMethod2(name, nil) +} + +func (t *itype) lookupBinMethod2(name string, seen map[*itype]bool) (m reflect.Method, index []int, isPtr, ok bool) { + if seen == nil { + seen = map[*itype]bool{} + } + if seen[t] { + return + } + seen[t] = true if t.cat == ptrT { - return t.val.lookupBinMethod(name) + return t.val.lookupBinMethod2(name, seen) } for i, f := range t.field { if f.embed { - if m2, index2, isPtr2, ok2 := f.typ.lookupBinMethod(name); ok2 { + if m2, index2, isPtr2, ok2 := f.typ.lookupBinMethod2(name, seen); ok2 { index = append([]int{i}, index2...) return m2, index, isPtr2, ok2 } @@ -1341,10 +1789,10 @@ func lookupFieldOrMethod(t *itype, name string) *itype { if t.rtype.Kind() != reflect.Interface { recv = t if isPtr && t.cat != ptrT && t.rtype.Kind() != reflect.Ptr { - recv = &itype{cat: ptrT, val: t} + recv = ptrOf(t) } } - return &itype{cat: valueT, rtype: m.Type, recv: recv} + return valueTOf(m.Type, withRecv(recv)) case t.cat == interfaceT: seq := t.lookupField(name) if seq == nil { @@ -1369,118 +1817,220 @@ func exportName(s string) string { var ( // TODO(mpl): generators. - interf = reflect.TypeOf((*interface{})(nil)).Elem() - constVal = reflect.TypeOf((*constant.Value)(nil)).Elem() + emptyInterfaceType = reflect.TypeOf((*interface{})(nil)).Elem() + valueInterfaceType = reflect.TypeOf((*valueInterface)(nil)).Elem() + constVal = reflect.TypeOf((*constant.Value)(nil)).Elem() ) +type fieldRebuild struct { + typ *itype + idx int +} + +type refTypeContext struct { + defined map[string]*itype + + // refs keeps track of all the places (in the same type recursion) where the + // type name (as key) is used as a field of another (or possibly the same) struct + // type. Each of these fields will then live as an unsafe2.dummy type until the + // whole recursion is fully resolved, and the type is fixed. + refs map[string][]fieldRebuild + + // When we detect for the first time that we are in a recursive type (thanks to + // defined), we keep track of the first occurrence of the type where the recursion + // started, so we can restart the last step that fixes all the types from the same + // "top-level" point. + rect *itype + rebuilding bool +} + +// Clone creates a copy of the ref type context. +func (c *refTypeContext) Clone() *refTypeContext { + return &refTypeContext{defined: c.defined, refs: c.refs, rebuilding: c.rebuilding} +} + +func (c *refTypeContext) isComplete() bool { + for _, t := range c.defined { + if t.rtype == nil { + return false + } + } + return true +} + +func (t *itype) fixDummy(typ reflect.Type) reflect.Type { + if typ == unsafe2.DummyType { + return t.rtype + } + switch typ.Kind() { + case reflect.Array: + return reflect.ArrayOf(typ.Len(), t.fixDummy(typ.Elem())) + case reflect.Chan: + return reflect.ChanOf(typ.ChanDir(), t.fixDummy(typ.Elem())) + case reflect.Func: + in := make([]reflect.Type, typ.NumIn()) + for i := range in { + in[i] = t.fixDummy(typ.In(i)) + } + out := make([]reflect.Type, typ.NumOut()) + for i := range out { + out[i] = t.fixDummy(typ.Out(i)) + } + return reflect.FuncOf(in, out, typ.IsVariadic()) + case reflect.Map: + return reflect.MapOf(t.fixDummy(typ.Key()), t.fixDummy(typ.Elem())) + case reflect.Ptr: + return reflect.PtrTo(t.fixDummy(typ.Elem())) + case reflect.Slice: + return reflect.SliceOf(t.fixDummy(typ.Elem())) + case reflect.Struct: + fields := make([]reflect.StructField, typ.NumField()) + for i := range fields { + fields[i] = typ.Field(i) + fields[i].Type = t.fixDummy(fields[i].Type) + } + return reflect.StructOf(fields) + } + return typ +} + // RefType returns a reflect.Type representation from an interpreter type. // In simple cases, reflect types are directly mapped from the interpreter // counterpart. // For recursive named struct or interfaces, as reflect does not permit to -// create a recursive named struct, an interface{} is returned in place to -// avoid infinitely nested structs. -func (t *itype) refType(defined map[string]*itype, wrapRecursive bool) reflect.Type { +// create a recursive named struct, a dummy type is set temporarily for each recursive +// field. When done, the dummy type fields are updated with the original reflect type +// pointer using unsafe. We thus obtain a usable recursive type definition, except +// for string representation, as created reflect types are still unnamed. +func (t *itype) refType(ctx *refTypeContext) reflect.Type { + if ctx == nil { + ctx = &refTypeContext{ + defined: map[string]*itype{}, + refs: map[string][]fieldRebuild{}, + } + } if t.incomplete || t.cat == nilT { var err error if t, err = t.finalize(); err != nil { panic(err) } } - recursive := false name := t.path + "/" + t.name - // Predefined types from universe or runtime may have a nil scope. - if t.scope != nil { - if st := t.scope.sym[t.name]; st != nil { - // Update the type recursive status. Several copies of type - // may exist per symbol, as a new type is created at each GTA - // pass (several needed due to out of order declarations), and - // a node can still point to a previous copy. - st.typ.recursive = st.typ.recursive || st.typ.isRecursive() - recursive = st.typ.isRecursive() - // It is possible that t.recursive is not inline with st.typ.recursive - // which will break recursion detection. Set it here to make sure it - // is correct. - t.recursive = recursive - } - } - if wrapRecursive && t.recursive { - return interf - } - if t.rtype != nil { + + if t.rtype != nil && !ctx.rebuilding { return t.rtype } - if defined[name] != nil && defined[name].rtype != nil { - return defined[name].rtype + if dt := ctx.defined[name]; dt != nil { + // We get here when we are a struct field, and our type name has already been + // seen at least once in one of our englobing structs. i.e. there's at least one + // level of type recursion. + if dt.rtype != nil { + t.rtype = dt.rtype + return dt.rtype + } + + // The recursion has not been fully resolved yet. + // To indicate that a rebuild is needed on the englobing struct, + // return a dummy field type and create an entry with an empty fieldRebuild. + flds := ctx.refs[name] + ctx.rect = dt + + // We know we are used as a field by someone, but we don't know by who + // at this point in the code, so we just mark it as an empty fieldRebuild for now. + // We'll complete the fieldRebuild in the caller. + ctx.refs[name] = append(flds, fieldRebuild{}) + return unsafe2.DummyType } - if t.val != nil && t.val.cat == structT && t.val.rtype == nil && hasRecursiveStruct(t.val, copyDefined(defined)) { - // Replace reference to self (direct or indirect) by an interface{} to handle - // recursive types with reflect. - typ := *t.val - t.val = &typ - t.val.rtype = interf - recursive = true + if isGeneric(t) { + return reflect.TypeOf((*generic)(nil)).Elem() } switch t.cat { case aliasT: - t.rtype = t.val.refType(defined, wrapRecursive) - case arrayT, variadicT: - if t.sizedef { - t.rtype = reflect.ArrayOf(t.size, t.val.refType(defined, wrapRecursive)) - } else { - t.rtype = reflect.SliceOf(t.val.refType(defined, wrapRecursive)) - } + t.rtype = t.val.refType(ctx) + case arrayT: + t.rtype = reflect.ArrayOf(t.length, t.val.refType(ctx)) + case sliceT, variadicT: + t.rtype = reflect.SliceOf(t.val.refType(ctx)) case chanT: - t.rtype = reflect.ChanOf(reflect.BothDir, t.val.refType(defined, wrapRecursive)) + t.rtype = reflect.ChanOf(reflect.BothDir, t.val.refType(ctx)) case chanRecvT: - t.rtype = reflect.ChanOf(reflect.RecvDir, t.val.refType(defined, wrapRecursive)) + t.rtype = reflect.ChanOf(reflect.RecvDir, t.val.refType(ctx)) case chanSendT: - t.rtype = reflect.ChanOf(reflect.SendDir, t.val.refType(defined, wrapRecursive)) + t.rtype = reflect.ChanOf(reflect.SendDir, t.val.refType(ctx)) case errorT: t.rtype = reflect.TypeOf(new(error)).Elem() case funcT: - if t.name != "" { - defined[name] = t // TODO(marc): make sure that key is name and not t.name. - } variadic := false in := make([]reflect.Type, len(t.arg)) out := make([]reflect.Type, len(t.ret)) for i, v := range t.arg { - in[i] = v.refType(defined, true) + in[i] = v.refType(ctx) variadic = v.cat == variadicT } for i, v := range t.ret { - out[i] = v.refType(defined, true) + out[i] = v.refType(ctx) } t.rtype = reflect.FuncOf(in, out, variadic) case interfaceT: - t.rtype = interf + if len(t.field) == 0 { + // empty interface, do not wrap it + t.rtype = emptyInterfaceType + break + } + t.rtype = valueInterfaceType case mapT: - t.rtype = reflect.MapOf(t.key.refType(defined, wrapRecursive), t.val.refType(defined, wrapRecursive)) + t.rtype = reflect.MapOf(t.key.refType(ctx), t.val.refType(ctx)) case ptrT: - t.rtype = reflect.PtrTo(t.val.refType(defined, wrapRecursive)) + t.rtype = reflect.PtrTo(t.val.refType(ctx)) case structT: if t.name != "" { - // Check against local t.name and not name to catch recursive type definitions. - if defined[t.name] != nil { - recursive = true - } - defined[t.name] = t + ctx.defined[name] = t } var fields []reflect.StructField - // TODO(mpl): make Anonymous work for recursive types too. Maybe not worth the - // effort, and we're better off just waiting for - // https://github.com/golang/go/issues/39717 to land. - for _, f := range t.field { + for i, f := range t.field { field := reflect.StructField{ - Name: exportName(f.name), Type: f.typ.refType(defined, wrapRecursive), - Tag: reflect.StructTag(f.tag), Anonymous: (f.embed && !recursive), + Name: exportName(f.name), Type: f.typ.refType(ctx), + Tag: reflect.StructTag(f.tag), Anonymous: f.embed, } fields = append(fields, field) + // Find any nil type refs that indicates a rebuild is needed on this field. + for _, flds := range ctx.refs { + for j, fld := range flds { + if fld.typ == nil { + flds[j] = fieldRebuild{typ: t, idx: i} + } + } + } } - if recursive && wrapRecursive { - t.rtype = interf - } else { - t.rtype = reflect.StructOf(fields) + fieldFix := []int{} // Slice of field indices to fix for recursivity. + t.rtype = reflect.StructOf(fields) + if ctx.isComplete() { + for _, s := range ctx.defined { + for i := 0; i < s.rtype.NumField(); i++ { + f := s.rtype.Field(i) + if strings.HasSuffix(f.Type.String(), "unsafe2.dummy") { + unsafe2.SetFieldType(s.rtype, i, ctx.rect.fixDummy(s.rtype.Field(i).Type)) + if name == s.path+"/"+s.name { + fieldFix = append(fieldFix, i) + } + } + } + } + } + + // The rtype has now been built, we can go back and rebuild + // all the recursive types that relied on this type. + // However, as we are keyed by type name, if two or more (recursive) fields at + // the same depth level are of the same type, or a "variation" of the same type + // (slice of, map of, etc), they "mask" each other, and only one + // of them is in ctx.refs. That is why the code around here is a bit convoluted, + // and we need both the loop above, around all the struct fields, and the loop + // below, around the ctx.refs. + for _, f := range ctx.refs[name] { + for _, index := range fieldFix { + ftyp := f.typ.field[index].typ.refType(&refTypeContext{defined: ctx.defined, rebuilding: true}) + unsafe2.SetFieldType(f.typ.rtype, index, ftyp) + } } default: if z, _ := t.zero(); z.IsValid() { @@ -1492,7 +2042,7 @@ func (t *itype) refType(defined map[string]*itype, wrapRecursive bool) reflect.T // TypeOf returns the reflection type of dynamic interpreter type t. func (t *itype) TypeOf() reflect.Type { - return t.refType(map[string]*itype{}, false) + return t.refType(nil) } func (t *itype) frameType() (r reflect.Type) { @@ -1503,21 +2053,21 @@ func (t *itype) frameType() (r reflect.Type) { switch t.cat { case aliasT: r = t.val.frameType() - case arrayT, variadicT: - if t.sizedef { - r = reflect.ArrayOf(t.size, t.val.frameType()) - } else { - r = reflect.SliceOf(t.val.frameType()) - } + case arrayT: + r = reflect.ArrayOf(t.length, t.val.frameType()) + case sliceT, variadicT: + r = reflect.SliceOf(t.val.frameType()) case funcT: r = reflect.TypeOf((*node)(nil)) case interfaceT: if len(t.field) == 0 { // empty interface, do not wrap it - r = reflect.TypeOf((*interface{})(nil)).Elem() + r = emptyInterfaceType break } - r = reflect.TypeOf((*valueInterface)(nil)).Elem() + r = valueInterfaceType + case mapT: + r = reflect.MapOf(t.key.frameType(), t.val.frameType()) case ptrT: r = reflect.PtrTo(t.val.frameType()) default: @@ -1527,83 +2077,94 @@ func (t *itype) frameType() (r reflect.Type) { } func (t *itype) implements(it *itype) bool { - if t.cat == valueT { + if isBin(t) { + // Note: in case of a valueInterfaceType, we + // miss required data which will be available + // later, so we optimistically return true to progress, + // and additional checks will be hopefully performed at + // runtime. + if rt := it.TypeOf(); rt == valueInterfaceType { + return true + } return t.TypeOf().Implements(it.TypeOf()) } return t.methods().contains(it.methods()) } // defaultType returns the default type of an untyped type. -func (t *itype) defaultType(v reflect.Value) *itype { +func (t *itype) defaultType(v reflect.Value, sc *scope) *itype { if !t.untyped { return t } + + typ := t // The default type can also be derived from a constant value. - if v.IsValid() && t.TypeOf().Implements(constVal) { + if v.IsValid() && v.Type().Implements(constVal) { switch v.Interface().(constant.Value).Kind() { case constant.String: - t = untypedString() + typ = sc.getType("string") case constant.Bool: - t = untypedBool() + typ = sc.getType("bool") case constant.Int: - t = untypedInt() + switch t.cat { + case int32T: + typ = sc.getType("int32") + default: + typ = sc.getType("int") + } case constant.Float: - t = untypedFloat() + typ = sc.getType("float64") case constant.Complex: - t = untypedComplex() + typ = sc.getType("complex128") + } + } + if typ.untyped { + switch t.cat { + case stringT: + typ = sc.getType("string") + case boolT: + typ = sc.getType("bool") + case intT: + typ = sc.getType("int") + case float64T: + typ = sc.getType("float64") + case complex128T: + typ = sc.getType("complex128") + default: + *typ = *t + typ.untyped = false } } - typ := *t - typ.untyped = false - return &typ + return typ } func (t *itype) isNil() bool { return t.cat == nilT } func (t *itype) hasNil() bool { - switch t.TypeOf().Kind() { + switch rt := t.TypeOf(); rt.Kind() { case reflect.UnsafePointer: return true case reflect.Slice, reflect.Ptr, reflect.Func, reflect.Interface, reflect.Map, reflect.Chan: return true + case reflect.Struct: + if rt == valueInterfaceType { + return true + } } return false } -func copyDefined(m map[string]*itype) map[string]*itype { - n := make(map[string]*itype, len(m)) - for k, v := range m { - n[k] = v +func (t *itype) elem() *itype { + if t.cat == valueT { + return valueTOf(t.rtype.Elem()) } - return n + return t.val } -// hasRecursiveStruct determines if a struct is a recursion or a recursion -// intermediate. A recursion intermediate is a struct that contains a recursive -// struct. -func hasRecursiveStruct(t *itype, defined map[string]*itype) bool { - if len(defined) == 0 { - return false - } - - typ := t - for typ != nil { - if typ.cat != structT { - typ = typ.val - continue - } - - if defined[typ.path+"/"+typ.name] != nil { - return true - } - defined[typ.path+"/"+typ.name] = typ - - for _, f := range typ.field { - if hasRecursiveStruct(f.typ, copyDefined(defined)) { - return true - } - } - return false +func hasElem(t reflect.Type) bool { + switch t.Kind() { + case reflect.Array, reflect.Chan, reflect.Map, reflect.Ptr, reflect.Slice: + return true } return false } @@ -1654,7 +2215,7 @@ func chanElement(t *itype) *itype { case chanT, chanSendT, chanRecvT: return t.val case valueT: - return &itype{cat: valueT, rtype: t.rtype.Elem(), node: t.node, scope: t.scope} + return valueTOf(t.rtype.Elem(), withNode(t.node), withScope(t.scope)) } return nil } @@ -1665,12 +2226,31 @@ func isFunc(t *itype) bool { return t.TypeOf().Kind() == reflect.Func } func isMap(t *itype) bool { return t.TypeOf().Kind() == reflect.Map } func isPtr(t *itype) bool { return t.TypeOf().Kind() == reflect.Ptr } +func isEmptyInterface(t *itype) bool { + return t.cat == interfaceT && len(t.field) == 0 +} + +func isGeneric(t *itype) bool { + return t.cat == funcT && t.node != nil && len(t.node.child) > 0 && len(t.node.child[0].child) > 0 +} + +func isFuncSrc(t *itype) bool { + return t.cat == funcT || (t.cat == aliasT && isFuncSrc(t.val)) +} + +func isPtrSrc(t *itype) bool { + return t.cat == ptrT || (t.cat == aliasT && isPtrSrc(t.val)) +} + func isSendChan(t *itype) bool { rt := t.TypeOf() return rt.Kind() == reflect.Chan && rt.ChanDir() == reflect.SendDir } func isArray(t *itype) bool { + if t.cat == nilT { + return false + } k := t.TypeOf().Kind() return k == reflect.Array || k == reflect.Slice } @@ -1680,11 +2260,22 @@ func isInterfaceSrc(t *itype) bool { } func isInterfaceBin(t *itype) bool { - return t.cat == valueT && t.rtype.Kind() == reflect.Interface + return t.cat == valueT && t.rtype.Kind() == reflect.Interface || t.cat == errorT } func isInterface(t *itype) bool { - return isInterfaceSrc(t) || t.TypeOf() != nil && t.TypeOf().Kind() == reflect.Interface + return isInterfaceSrc(t) || t.TypeOf() == valueInterfaceType || t.TypeOf() != nil && t.TypeOf().Kind() == reflect.Interface +} + +func isBin(t *itype) bool { + switch t.cat { + case valueT: + return true + case aliasT, ptrT: + return isBin(t.val) + default: + return false + } } func isStruct(t *itype) bool { diff --git a/vendor/github.com/traefik/yaegi/interp/typecheck.go b/vendor/github.com/traefik/yaegi/interp/typecheck.go index b05080f..e0473cb 100644 --- a/vendor/github.com/traefik/yaegi/interp/typecheck.go +++ b/vendor/github.com/traefik/yaegi/interp/typecheck.go @@ -3,6 +3,7 @@ package interp import ( "errors" "go/constant" + "go/token" "math" "reflect" ) @@ -14,7 +15,9 @@ type opPredicates map[action]func(reflect.Type) bool // Due to variant type systems (itype vs reflect.Type) a single // type system should used, namely reflect.Type with exception // of the untyped flag on itype. -type typecheck struct{} +type typecheck struct { + scope *scope +} // op type checks an expression against a set of expression predicates. func (check typecheck) op(p opPredicates, a action, n, c *node, t reflect.Type) error { @@ -32,12 +35,15 @@ func (check typecheck) op(p opPredicates, a action, n, c *node, t reflect.Type) // // Use typ == nil to indicate assignment to an untyped blank identifier. func (check typecheck) assignment(n *node, typ *itype, context string) error { + if n.typ == nil { + return n.cfgErrorf("invalid type in %s", context) + } if n.typ.untyped { if typ == nil || isInterface(typ) { if typ == nil && n.typ.cat == nilT { return n.cfgErrorf("use of untyped nil in %s", context) } - typ = n.typ.defaultType(n.rval) + typ = n.typ.defaultType(n.rval, check.scope) } if err := check.convertUntyped(n, typ); err != nil { return err @@ -48,7 +54,7 @@ func (check typecheck) assignment(n *node, typ *itype, context string) error { return nil } - if !n.typ.assignableTo(typ) { + if !n.typ.assignableTo(typ) && typ.str != "*unsafe2.dummy" { if context == "" { return n.cfgErrorf("cannot use type %s as type %s", n.typ.id(), typ.id()) } @@ -65,7 +71,7 @@ func (check typecheck) assignExpr(n, dest, src *node) error { isConst := n.anc.kind == constDecl if !isConst { // var operations must be typed - dest.typ = dest.typ.defaultType(src.rval) + dest.typ = dest.typ.defaultType(src.rval, check.scope) } return check.assignment(src, dest.typ, "assignment") @@ -98,6 +104,7 @@ func (check typecheck) addressExpr(n *node) error { c := c0.child[0] if isArray(c.typ) || isMap(c.typ) { c0 = c + found = true continue } case compositeLitExpr, identExpr: @@ -118,6 +125,8 @@ func (check typecheck) starExpr(n *node) error { } var unaryOpPredicates = opPredicates{ + aInc: isNumber, + aDec: isNumber, aPos: isNumber, aNeg: isNumber, aBitNot: isInt, @@ -127,6 +136,9 @@ var unaryOpPredicates = opPredicates{ // unaryExpr type checks a unary expression. func (check typecheck) unaryExpr(n *node) error { c0 := n.child[0] + if isBlank(c0) { + return n.cfgErrorf("cannot use _ as value") + } t0 := c0.typ.TypeOf() if n.action == aRecv { @@ -139,10 +151,7 @@ func (check typecheck) unaryExpr(n *node) error { return nil } - if err := check.op(unaryOpPredicates, n.action, n, c0, t0); err != nil { - return err - } - return nil + return check.op(unaryOpPredicates, n.action, n, c0, t0) } // shift type checks a shift binary expression. @@ -162,7 +171,7 @@ func (check typecheck) shift(n *node) error { switch { case c1.typ.untyped: - if err := check.convertUntyped(c1, &itype{cat: uintT, name: "uint"}); err != nil { + if err := check.convertUntyped(c1, check.scope.getType("uint")); err != nil { return n.cfgErrorf("invalid operation: shift count type %v, must be integer", c1.typ.id()) } case isInt(t1): @@ -175,25 +184,31 @@ func (check typecheck) shift(n *node) error { // comparison type checks a comparison binary expression. func (check typecheck) comparison(n *node) error { - c0, c1 := n.child[0], n.child[1] + t0, t1 := n.child[0].typ, n.child[1].typ - if !c0.typ.assignableTo(c1.typ) && !c1.typ.assignableTo(c0.typ) { - return n.cfgErrorf("invalid operation: mismatched types %s and %s", c0.typ.id(), c1.typ.id()) + if !t0.assignableTo(t1) && !t1.assignableTo(t0) { + return n.cfgErrorf("invalid operation: mismatched types %s and %s", t0.id(), t1.id()) } ok := false + + if !isInterface(t0) && !isInterface(t1) && !t0.isNil() && !t1.isNil() && t0.untyped == t1.untyped && t0.id() != t1.id() && !typeDefined(t0, t1) { + // Non interface types must be really equals. + return n.cfgErrorf("invalid operation: mismatched types %s and %s", t0.id(), t1.id()) + } + switch n.action { case aEqual, aNotEqual: - ok = c0.typ.comparable() && c1.typ.comparable() || c0.typ.isNil() && c1.typ.hasNil() || c1.typ.isNil() && c0.typ.hasNil() + ok = t0.comparable() && t1.comparable() || t0.isNil() && t1.hasNil() || t1.isNil() && t0.hasNil() case aLower, aLowerEqual, aGreater, aGreaterEqual: - ok = c0.typ.ordered() && c1.typ.ordered() + ok = t0.ordered() && t1.ordered() } if !ok { - typ := c0.typ + typ := t0 if typ.isNil() { - typ = c1.typ + typ = t1 } - return n.cfgErrorf("invalid operation: operator %v not defined on %s", n.action, typ.id(), ".") + return n.cfgErrorf("invalid operation: operator %v not defined on %s", n.action, typ.id()) } return nil } @@ -218,6 +233,10 @@ var binaryOpPredicates = opPredicates{ func (check typecheck) binaryExpr(n *node) error { c0, c1 := n.child[0], n.child[1] + if isBlank(c0) || isBlank(c1) { + return n.cfgErrorf("cannot use _ as value") + } + a := n.action if isAssignAction(a) { a-- @@ -228,6 +247,15 @@ func (check typecheck) binaryExpr(n *node) error { } switch n.action { + case aAdd: + if n.typ == nil { + break + } + // Catch mixing string and number for "+" operator use. + k, k0, k1 := isNumber(n.typ.TypeOf()), isNumber(c0.typ.TypeOf()), isNumber(c1.typ.TypeOf()) + if k != k0 || k != k1 { + return n.cfgErrorf("cannot use type %s as type %s in assignment", c0.typ.id(), n.typ.id()) + } case aRem: if zeroConst(c1) { return n.cfgErrorf("invalid operation: division by zero") @@ -254,10 +282,8 @@ func (check typecheck) binaryExpr(n *node) error { } t0 := c0.typ.TypeOf() - if err := check.op(binaryOpPredicates, a, n, c0, t0); err != nil { - return err - } - return nil + + return check.op(binaryOpPredicates, a, n, c0, t0) } func zeroConst(n *node) bool { @@ -265,7 +291,7 @@ func zeroConst(n *node) bool { } func (check typecheck) index(n *node, max int) error { - if err := check.convertUntyped(n, &itype{cat: intT, name: "int"}); err != nil { + if err := check.convertUntyped(n, check.scope.getType("int")); err != nil { return err } @@ -285,7 +311,10 @@ func (check typecheck) index(n *node, max int) error { } // arrayLitExpr type checks an array composite literal expression. -func (check typecheck) arrayLitExpr(child []*node, typ *itype, length int) error { +func (check typecheck) arrayLitExpr(child []*node, typ *itype) error { + cat := typ.cat + length := typ.length + typ = typ.val visited := make(map[int]bool, len(child)) index := 0 for _, c := range child { @@ -297,7 +326,7 @@ func (check typecheck) arrayLitExpr(child []*node, typ *itype, length int) error } n = c.child[1] index = int(vInt(c.child[0].rval)) - case length > 0 && index >= length: + case cat == arrayT && index >= length: return c.cfgErrorf("index %d is out of bounds (>= %d)", index, length) } @@ -425,7 +454,7 @@ func (check typecheck) structBinLitExpr(child []*node, typ reflect.Type) error { return c.cfgErrorf("unknown field %s in struct literal", name) } - if err := check.assignment(val, &itype{cat: valueT, rtype: field.Type}, "struct literal"); err != nil { + if err := check.assignment(val, valueTOf(field.Type), "struct literal"); err != nil { return err } @@ -451,7 +480,7 @@ func (check typecheck) structBinLitExpr(child []*node, typ reflect.Type) error { return c.cfgErrorf("implicit assignment to unexported field %s in %s literal", field.Name, typ) } - if err := check.assignment(c, &itype{cat: valueT, rtype: field.Type}, "struct literal"); err != nil { + if err := check.assignment(c, valueTOf(field.Type), "struct literal"); err != nil { return err } } @@ -463,6 +492,12 @@ func (check typecheck) structBinLitExpr(child []*node, typ reflect.Type) error { // sliceExpr type checks a slice expression. func (check typecheck) sliceExpr(n *node) error { + for _, c := range n.child { + if isBlank(c) { + return n.cfgErrorf("cannot use _ as value") + } + } + c, child := n.child[0], n.child[1:] t := c.typ.TypeOf() @@ -555,7 +590,7 @@ func (check typecheck) typeAssertionExpr(n *node, typ *itype) error { // https://github.com/golang/go/issues/39717 lands. It is currently impractical to // type check Named types as they cannot be asserted. - if n.typ.TypeOf().Kind() != reflect.Interface { + if rt := n.typ.TypeOf(); rt.Kind() != reflect.Interface && rt != valueInterfaceType { return n.cfgErrorf("invalid type assertion: non-interface type %s on left", n.typ.id()) } ims := n.typ.methods() @@ -578,6 +613,12 @@ func (check typecheck) typeAssertionExpr(n *node, typ *itype) error { continue } if tm == nil { + // Lookup for non-exported methods is impossible + // for bin types, ignore them as they can't be used + // directly by the interpreted programs. + if !token.IsExported(name) && isBin(typ) { + continue + } return n.cfgErrorf("impossible type assertion: %s does not implement %s (missing %v method)", typ.id(), n.typ.id(), name) } if tm.recv != nil && tm.recv.TypeOf().Kind() == reflect.Ptr && typ.TypeOf().Kind() != reflect.Ptr { @@ -636,7 +677,7 @@ func (check typecheck) conversion(n *node, typ *itype) error { return nil } if isInterface(typ) || !isConstType(typ) { - typ = n.typ.defaultType(n.rval) + typ = n.typ.defaultType(n.rval, check.scope) } return check.convertUntyped(n, typ) } @@ -720,29 +761,28 @@ func (check typecheck) builtin(name string, n *node, child []*node, ellipsis boo case bltnAppend: typ := params[0].Type() t := typ.TypeOf() - if t.Kind() != reflect.Slice { + if t == nil || t.Kind() != reflect.Slice { return params[0].nod.cfgErrorf("first argument to append must be slice; have %s", typ.id()) } + if nparams == 1 { + return nil + } // Special case append([]byte, "test"...) is allowed. t1 := params[1].Type() if nparams == 2 && ellipsis && t.Elem().Kind() == reflect.Uint8 && t1.TypeOf().Kind() == reflect.String { if t1.untyped { - return check.convertUntyped(params[1].nod, &itype{cat: stringT, name: "string"}) + return check.convertUntyped(params[1].nod, check.scope.getType("string")) } return nil } - // We cannot check a recursive type. - if isRecursiveType(typ, typ.TypeOf()) { - return nil - } fun := &node{ typ: &itype{ cat: funcT, arg: []*itype{ typ, - {cat: variadicT, val: &itype{cat: valueT, rtype: t.Elem()}}, + {cat: variadicT, val: valueTOf(t.Elem())}, }, ret: []*itype{typ}, }, @@ -781,7 +821,7 @@ func (check typecheck) builtin(name string, n *node, child []*node, ellipsis boo case !typ0.untyped && typ1.untyped: err = check.convertUntyped(p1.nod, typ0) case typ0.untyped && typ1.untyped: - fltType := &itype{cat: float64T, name: "float64"} + fltType := untypedFloat(nil) err = check.convertUntyped(p0.nod, fltType) if err != nil { break @@ -804,7 +844,7 @@ func (check typecheck) builtin(name string, n *node, child []*node, ellipsis boo p := params[0] typ := p.Type() if typ.untyped { - if err := check.convertUntyped(p.nod, &itype{cat: complex128T, name: "complex128"}); err != nil { + if err := check.convertUntyped(p.nod, untypedComplex(nil)); err != nil { return err } } @@ -838,7 +878,7 @@ func (check typecheck) builtin(name string, n *node, child []*node, ellipsis boo return params[0].nod.cfgErrorf("first argument to delete must be map; have %s", typ.id()) } ktyp := params[1].Type() - if !ktyp.assignableTo(typ.key) { + if typ.key != nil && !ktyp.assignableTo(typ.key) { return params[1].nod.cfgErrorf("cannot use %s as type %s in delete", ktyp.id(), typ.key.id()) } case bltnMake: @@ -871,7 +911,7 @@ func (check typecheck) builtin(name string, n *node, child []*node, ellipsis boo } case bltnPanic: - return check.assignment(params[0].nod, &itype{cat: interfaceT}, "argument to panic") + return check.assignment(params[0].nod, check.scope.getType("interface{}"), "argument to panic") case bltnPrint, bltnPrintln: for _, param := range params { if param.typ != nil { @@ -895,12 +935,12 @@ func arrayDeref(typ *itype) *itype { if typ.cat == valueT && typ.TypeOf().Kind() == reflect.Ptr { t := typ.TypeOf() if t.Elem().Kind() == reflect.Array { - return &itype{cat: valueT, rtype: t.Elem()} + return valueTOf(t.Elem()) } return typ } - if typ.cat == ptrT && typ.val.cat == arrayT && typ.val.sizedef { + if typ.cat == ptrT && typ.val.cat == arrayT { return typ.val } return typ @@ -955,8 +995,8 @@ func (check typecheck) argument(p param, ftyp *itype, i, l int, ellipsis bool) e return p.nod.cfgErrorf("can only use ... with matching parameter") } t := p.Type().TypeOf() - if t.Kind() != reflect.Slice || !(&itype{cat: valueT, rtype: t.Elem()}).assignableTo(atyp) { - return p.nod.cfgErrorf("cannot use %s as type %s", p.nod.typ.id(), (&itype{cat: arrayT, val: atyp}).id()) + if t.Kind() != reflect.Slice || !(valueTOf(t.Elem())).assignableTo(atyp) { + return p.nod.cfgErrorf("cannot use %s as type %s", p.nod.typ.id(), (sliceOf(atyp)).id()) } return nil } @@ -978,6 +1018,8 @@ func getArg(ftyp *itype, i int) *itype { return arg case i < l: return ftyp.in(i) + case ftyp.cat == valueT && i < ftyp.rtype.NumIn(): + return valueTOf(ftyp.rtype.In(i)) default: return nil } @@ -1037,7 +1079,7 @@ func (check typecheck) convertUntyped(n *node, typ *itype) error { if len(n.typ.methods()) > 0 { // untyped cannot be set to iface return convErr } - ityp = n.typ.defaultType(n.rval) + ityp = n.typ.defaultType(n.rval, check.scope) rtyp = ntyp case isArray(typ) || isMap(typ) || isChan(typ) || isFunc(typ) || isPtr(typ): // TODO(nick): above we are acting on itype, but really it is an rtype check. This is not clear which type diff --git a/vendor/github.com/traefik/yaegi/interp/typestring.go b/vendor/github.com/traefik/yaegi/interp/typestring.go new file mode 100644 index 0000000..346f9da --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/typestring.go @@ -0,0 +1,40 @@ +package interp + +import "strings" + +func paramsTypeString(params []*itype) string { + strs := make([]string, 0, len(params)) + for _, param := range params { + strs = append(strs, param.str) + } + return strings.Join(strs, ",") +} + +func methodsTypeString(fields []structField) string { + strs := make([]string, 0, len(fields)) + for _, field := range fields { + if field.embed { + str := methodsTypeString(field.typ.field) + if str != "" { + strs = append(strs, str) + } + continue + } + strs = append(strs, field.name+field.typ.str[4:]) + } + return strings.Join(strs, "; ") +} + +func fieldsTypeString(fields []structField) string { + strs := make([]string, 0, len(fields)) + for _, field := range fields { + var repr strings.Builder + if !field.embed { + repr.WriteString(field.name) + repr.WriteByte(' ') + } + repr.WriteString(field.typ.str) + strs = append(strs, repr.String()) + } + return strings.Join(strs, "; ") +} diff --git a/vendor/github.com/traefik/yaegi/interp/use.go b/vendor/github.com/traefik/yaegi/interp/use.go new file mode 100644 index 0000000..b4dec1f --- /dev/null +++ b/vendor/github.com/traefik/yaegi/interp/use.go @@ -0,0 +1,252 @@ +package interp + +import ( + "flag" + "fmt" + "go/constant" + "log" + "math/bits" + "os" + "path" + "reflect" +) + +// Symbols returns a map of interpreter exported symbol values for the given +// import path. If the argument is the empty string, all known symbols are +// returned. +func (interp *Interpreter) Symbols(importPath string) Exports { + m := map[string]map[string]reflect.Value{} + interp.mutex.RLock() + defer interp.mutex.RUnlock() + + for k, v := range interp.srcPkg { + if importPath != "" && k != importPath { + continue + } + syms := map[string]reflect.Value{} + for n, s := range v { + if !canExport(n) { + // Skip private non-exported symbols. + continue + } + switch s.kind { + case constSym: + syms[n] = s.rval + case funcSym: + syms[n] = genFunctionWrapper(s.node)(interp.frame) + case varSym: + syms[n] = interp.frame.data[s.index] + case typeSym: + syms[n] = reflect.New(s.typ.TypeOf()) + } + } + + if len(syms) > 0 { + m[k] = syms + } + + if importPath != "" { + return m + } + } + + if importPath != "" && len(m) > 0 { + return m + } + + for k, v := range interp.binPkg { + if importPath != "" && k != importPath { + continue + } + m[k] = v + if importPath != "" { + return m + } + } + + return m +} + +// getWrapper returns the wrapper type of the corresponding interface, trying +// first the composed ones, or nil if not found. +func getWrapper(n *node, t reflect.Type) reflect.Type { + p, ok := n.interp.binPkg[t.PkgPath()] + if !ok { + return nil + } + w := p["_"+t.Name()] + lm := n.typ.methods() + + // mapTypes may contain composed interfaces wrappers to test against, from + // most complex to simplest (guaranteed by construction of mapTypes). Find the + // first for which the interpreter type has all the methods. + for _, rt := range n.interp.mapTypes[w] { + match := true + for i := 1; i < rt.NumField(); i++ { + // The interpreter type must have all required wrapper methods. + if _, ok := lm[rt.Field(i).Name[1:]]; !ok { + match = false + break + } + } + if match { + return rt + } + } + + // Otherwise return the direct "non-composed" interface. + return w.Type().Elem() +} + +// Use loads binary runtime symbols in the interpreter context so +// they can be used in interpreted code. +func (interp *Interpreter) Use(values Exports) error { + for k, v := range values { + importPath := path.Dir(k) + packageName := path.Base(k) + + if k == "." && v["MapTypes"].IsValid() { + // Use mapping for special interface wrappers. + for kk, vv := range v["MapTypes"].Interface().(map[reflect.Value][]reflect.Type) { + interp.mapTypes[kk] = vv + } + continue + } + + if importPath == "." { + return fmt.Errorf("export path %[1]q is missing a package name; did you mean '%[1]s/%[1]s'?", k) + } + + if importPath == selfPrefix { + interp.hooks.Parse(v) + continue + } + + if interp.binPkg[importPath] == nil { + interp.binPkg[importPath] = make(map[string]reflect.Value) + interp.pkgNames[importPath] = packageName + } + + for s, sym := range v { + interp.binPkg[importPath][s] = sym + } + if k == selfPath { + interp.binPkg[importPath]["Self"] = reflect.ValueOf(interp) + } + } + + // Checks if input values correspond to stdlib packages by looking for one + // well known stdlib package path. + if _, ok := values["fmt/fmt"]; ok { + fixStdlib(interp) + } + return nil +} + +// fixStdlib redefines interpreter stdlib symbols to use the standard input, +// output and errror assigned to the interpreter. The changes are limited to +// the interpreter only. +// Note that it is possible to escape the virtualized stdio by +// read/write directly to file descriptors 0, 1, 2. +func fixStdlib(interp *Interpreter) { + p := interp.binPkg["fmt"] + if p == nil { + return + } + + stdin, stdout, stderr := interp.stdin, interp.stdout, interp.stderr + + p["Print"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fprint(stdout, a...) }) + p["Printf"] = reflect.ValueOf(func(f string, a ...interface{}) (n int, err error) { return fmt.Fprintf(stdout, f, a...) }) + p["Println"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fprintln(stdout, a...) }) + + p["Scan"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fscan(stdin, a...) }) + p["Scanf"] = reflect.ValueOf(func(f string, a ...interface{}) (n int, err error) { return fmt.Fscanf(stdin, f, a...) }) + p["Scanln"] = reflect.ValueOf(func(a ...interface{}) (n int, err error) { return fmt.Fscanln(stdin, a...) }) + + // Update mapTypes to virtualized symbols as well. + interp.mapTypes[p["Print"]] = interp.mapTypes[reflect.ValueOf(fmt.Print)] + interp.mapTypes[p["Printf"]] = interp.mapTypes[reflect.ValueOf(fmt.Printf)] + interp.mapTypes[p["Println"]] = interp.mapTypes[reflect.ValueOf(fmt.Println)] + interp.mapTypes[p["Scan"]] = interp.mapTypes[reflect.ValueOf(fmt.Scan)] + interp.mapTypes[p["Scanf"]] = interp.mapTypes[reflect.ValueOf(fmt.Scanf)] + interp.mapTypes[p["Scanln"]] = interp.mapTypes[reflect.ValueOf(fmt.Scanln)] + + if p = interp.binPkg["flag"]; p != nil { + c := flag.NewFlagSet(os.Args[0], flag.PanicOnError) + c.SetOutput(stderr) + p["CommandLine"] = reflect.ValueOf(&c).Elem() + } + + if p = interp.binPkg["log"]; p != nil { + l := log.New(stderr, "", log.LstdFlags) + // Restrict Fatal symbols to panic instead of exit. + p["Fatal"] = reflect.ValueOf(l.Panic) + p["Fatalf"] = reflect.ValueOf(l.Panicf) + p["Fatalln"] = reflect.ValueOf(l.Panicln) + + p["Flags"] = reflect.ValueOf(l.Flags) + p["Output"] = reflect.ValueOf(l.Output) + p["Panic"] = reflect.ValueOf(l.Panic) + p["Panicf"] = reflect.ValueOf(l.Panicf) + p["Panicln"] = reflect.ValueOf(l.Panicln) + p["Prefix"] = reflect.ValueOf(l.Prefix) + p["Print"] = reflect.ValueOf(l.Print) + p["Printf"] = reflect.ValueOf(l.Printf) + p["Println"] = reflect.ValueOf(l.Println) + p["SetFlags"] = reflect.ValueOf(l.SetFlags) + p["SetOutput"] = reflect.ValueOf(l.SetOutput) + p["SetPrefix"] = reflect.ValueOf(l.SetPrefix) + p["Writer"] = reflect.ValueOf(l.Writer) + + // Update mapTypes to virtualized symbols as well. + interp.mapTypes[p["Print"]] = interp.mapTypes[reflect.ValueOf(log.Print)] + interp.mapTypes[p["Printf"]] = interp.mapTypes[reflect.ValueOf(log.Printf)] + interp.mapTypes[p["Println"]] = interp.mapTypes[reflect.ValueOf(log.Println)] + interp.mapTypes[p["Panic"]] = interp.mapTypes[reflect.ValueOf(log.Panic)] + interp.mapTypes[p["Panicf"]] = interp.mapTypes[reflect.ValueOf(log.Panicf)] + interp.mapTypes[p["Panicln"]] = interp.mapTypes[reflect.ValueOf(log.Panicln)] + } + + if p = interp.binPkg["os"]; p != nil { + p["Args"] = reflect.ValueOf(&interp.args).Elem() + if interp.specialStdio { + // Inherit streams from interpreter even if they do not have a file descriptor. + p["Stdin"] = reflect.ValueOf(&stdin).Elem() + p["Stdout"] = reflect.ValueOf(&stdout).Elem() + p["Stderr"] = reflect.ValueOf(&stderr).Elem() + } else { + // Inherits streams from interpreter only if they have a file descriptor and preserve original type. + if s, ok := stdin.(*os.File); ok { + p["Stdin"] = reflect.ValueOf(&s).Elem() + } + if s, ok := stdout.(*os.File); ok { + p["Stdout"] = reflect.ValueOf(&s).Elem() + } + if s, ok := stderr.(*os.File); ok { + p["Stderr"] = reflect.ValueOf(&s).Elem() + } + } + if !interp.unrestricted { + // In restricted mode, scripts can only access to a passed virtualized env, and can not write the real one. + getenv := func(key string) string { return interp.env[key] } + p["Clearenv"] = reflect.ValueOf(func() { interp.env = map[string]string{} }) + p["ExpandEnv"] = reflect.ValueOf(func(s string) string { return os.Expand(s, getenv) }) + p["Getenv"] = reflect.ValueOf(getenv) + p["LookupEnv"] = reflect.ValueOf(func(key string) (s string, ok bool) { s, ok = interp.env[key]; return }) + p["Setenv"] = reflect.ValueOf(func(key, value string) error { interp.env[key] = value; return nil }) + p["Unsetenv"] = reflect.ValueOf(func(key string) error { delete(interp.env, key); return nil }) + p["Environ"] = reflect.ValueOf(func() (a []string) { + for k, v := range interp.env { + a = append(a, k+"="+v) + } + return + }) + } + } + + if p = interp.binPkg["math/bits"]; p != nil { + // Do not trust extracted value maybe from another arch. + p["UintSize"] = reflect.ValueOf(constant.MakeInt64(bits.UintSize)) + } +} diff --git a/vendor/github.com/traefik/yaegi/interp/value.go b/vendor/github.com/traefik/yaegi/interp/value.go index b83db7f..7ecf484 100644 --- a/vendor/github.com/traefik/yaegi/interp/value.go +++ b/vendor/github.com/traefik/yaegi/interp/value.go @@ -34,10 +34,10 @@ func valueGenerator(n *node, i int) func(*frame) reflect.Value { // because a cancellation prior to any evaluation result may leave // the frame's data empty. func valueOf(data []reflect.Value, i int) reflect.Value { - if i < len(data) { - return data[i] + if i < 0 || i >= len(data) { + return reflect.Value{} } - return reflect.Value{} + return data[i] } func genValueBinMethodOnInterface(n *node, defaultGen func(*frame) reflect.Value) func(*frame) reflect.Value { @@ -65,22 +65,30 @@ func genValueBinMethodOnInterface(n *node, defaultGen func(*frame) reflect.Value nod = vi.node } - if nod == nil { + if nod == nil || nod.typ.rtype == nil { return defaultGen(f) } - typ := nod.typ - if typ.node != nil || typ.cat != valueT { + // Try to get the bin method, if it doesnt exist, fall back to + // the default generator function. + meth, ok := nod.typ.rtype.MethodByName(c0.child[1].ident) + if !ok { return defaultGen(f) } - meth, _ := typ.rtype.MethodByName(c0.child[1].ident) + return meth.Func } } func genValueRecvIndirect(n *node) func(*frame) reflect.Value { - v := genValueRecv(n) - return func(f *frame) reflect.Value { return v(f).Elem() } + vr := genValueRecv(n) + return func(f *frame) reflect.Value { + v := vr(f) + if vi, ok := v.Interface().(valueInterface); ok { + return vi.value + } + return v.Elem() + } } func genValueRecv(n *node) func(*frame) reflect.Value { @@ -129,25 +137,6 @@ func genValueBinRecv(n *node, recv *receiver) func(*frame) reflect.Value { } } -func genValueRecvInterfacePtr(n *node) func(*frame) reflect.Value { - v := genValue(n.recv.node) - fi := n.recv.index - - return func(f *frame) reflect.Value { - r := v(f) - r = r.Elem().Elem() - - if len(fi) == 0 { - return r - } - - if r.Kind() == reflect.Ptr { - r = r.Elem() - } - return r.FieldByIndex(fi) - } -} - func genValueAsFunctionWrapper(n *node) func(*frame) reflect.Value { value := genValue(n) typ := n.typ.TypeOf() @@ -157,14 +146,27 @@ func genValueAsFunctionWrapper(n *node) func(*frame) reflect.Value { if v.IsNil() { return reflect.New(typ).Elem() } - return genFunctionWrapper(v.Interface().(*node))(f) + vn, ok := v.Interface().(*node) + if ok && vn.rval.Kind() == reflect.Func { + // The node value is already a callable func, no need to wrap it. + return vn.rval + } + return genFunctionWrapper(vn)(f) } } func genValueAs(n *node, t reflect.Type) func(*frame) reflect.Value { - v := genValue(n) + value := genValue(n) + return func(f *frame) reflect.Value { - return v(f).Convert(t) + v := value(f) + switch v.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice, reflect.UnsafePointer: + if v.IsNil() { + return reflect.New(t).Elem() + } + } + return v.Convert(t) } } @@ -174,7 +176,7 @@ func genValue(n *node) func(*frame) reflect.Value { convertConstantValue(n) v := n.rval if !v.IsValid() { - v = reflect.New(interf).Elem() + v = reflect.New(emptyInterfaceType).Elem() } return func(f *frame) reflect.Value { return v } case funcDecl: @@ -193,7 +195,7 @@ func genValue(n *node) func(*frame) reflect.Value { } if n.sym != nil { i := n.sym.index - if i < 0 { + if i < 0 && n != n.sym.node { return genValue(n.sym.node) } if n.sym.global { @@ -214,6 +216,27 @@ func genValue(n *node) func(*frame) reflect.Value { } } +func genDestValue(typ *itype, n *node) func(*frame) reflect.Value { + convertLiteralValue(n, typ.TypeOf()) + switch { + case isInterfaceSrc(typ) && (!isEmptyInterface(typ) || len(n.typ.method) > 0): + return genValueInterface(n) + case isFuncSrc(typ) && (n.typ.cat == valueT || n.typ.cat == nilT): + return genValueNode(n) + case typ.cat == valueT && isFuncSrc(n.typ): + return genFunctionWrapper(n) + case isInterfaceBin(typ): + return genInterfaceWrapper(n, typ.rtype) + case n.kind == basicLit && n.val == nil: + return func(*frame) reflect.Value { return reflect.New(typ.rtype).Elem() } + case n.typ.untyped && isComplex(typ.TypeOf()): + return genValueComplex(n) + case n.typ.untyped && !typ.untyped: + return genValueAs(n, typ.TypeOf()) + } + return genValue(n) +} + func genValueArray(n *node) func(*frame) reflect.Value { value := genValue(n) // dereference array pointer, to support array operations on array pointer @@ -264,19 +287,6 @@ func genValueRangeArray(n *node) func(*frame) reflect.Value { } } -func genValueInterfaceArray(n *node) func(*frame) reflect.Value { - value := genValue(n) - return func(f *frame) reflect.Value { - vi := value(f).Interface().([]valueInterface) - v := reflect.MakeSlice(reflect.TypeOf([]interface{}{}), len(vi), len(vi)) - for i, vv := range vi { - v.Index(i).Set(vv.value) - } - - return v - } -} - func genValueInterface(n *node) func(*frame) reflect.Value { value := genValue(n) @@ -295,7 +305,7 @@ func genValueInterface(n *node) func(*frame) reflect.Value { } // empty interface, do not wrap. - if nod.typ.cat == interfaceT && len(nod.typ.field) == 0 { + if nod != nil && isEmptyInterface(nod.typ) { return v } @@ -303,14 +313,42 @@ func genValueInterface(n *node) func(*frame) reflect.Value { } } +func getConcreteValue(val reflect.Value) reflect.Value { + v := val + for { + vi, ok := v.Interface().(valueInterface) + if !ok { + break + } + v = vi.value + } + if v.NumMethod() > 0 { + return v + } + if v.Kind() != reflect.Struct { + return v + } + // Search a concrete value in fields of an emulated interface. + for i := v.NumField() - 1; i >= 0; i-- { + vv := v.Field(i) + if vv.Kind() == reflect.Interface { + vv = vv.Elem() + } + if vv.IsValid() { + return vv + } + } + return v +} + func zeroInterfaceValue() reflect.Value { - n := &node{kind: basicLit, typ: &itype{cat: nilT, untyped: true}} - v := reflect.New(interf).Elem() + n := &node{kind: basicLit, typ: &itype{cat: nilT, untyped: true, str: "nil"}} + v := reflect.New(emptyInterfaceType).Elem() return reflect.ValueOf(valueInterface{n, v}) } func wantEmptyInterface(n *node) bool { - return n.typ.cat == interfaceT && len(n.typ.field) == 0 || + return isEmptyInterface(n.typ) || n.anc.action == aAssign && n.anc.typ.cat == interfaceT && len(n.anc.typ.field) == 0 || n.anc.kind == returnStmt && n.anc.val.(*node).typ.ret[0].cat == interfaceT && len(n.anc.val.(*node).typ.ret[0].field) == 0 } @@ -325,7 +363,7 @@ func genValueOutput(n *node, t reflect.Type) func(*frame) reflect.Value { } fallthrough case n.anc.kind == returnStmt && n.anc.val.(*node).typ.ret[0].cat == interfaceT: - if len(n.anc.val.(*node).typ.ret[0].field) == 0 { + if nod, ok := n.anc.val.(*node); !ok || len(nod.typ.ret[0].field) == 0 { // empty interface, do not wrap return value } @@ -341,6 +379,21 @@ func genValueOutput(n *node, t reflect.Type) func(*frame) reflect.Value { return value } +func getBinValue(getMapType func(*itype) reflect.Type, value func(*frame) reflect.Value, f *frame) reflect.Value { + v := value(f) + if getMapType == nil { + return v + } + val, ok := v.Interface().(valueInterface) + if !ok || val.node == nil { + return v + } + if rt := getMapType(val.node.typ); rt != nil { + return genInterfaceWrapper(val.node, rt)(f) + } + return v +} + func valueInterfaceValue(v reflect.Value) reflect.Value { for { vv, ok := v.Interface().(valueInterface) @@ -357,7 +410,7 @@ func genValueInterfaceValue(n *node) func(*frame) reflect.Value { return func(f *frame) reflect.Value { v := value(f) - if v.Interface().(valueInterface).node == nil { + if vi, ok := v.Interface().(valueInterface); ok && vi.node == nil { // Uninitialized interface value, set it to a correct zero value. v.Set(zeroInterfaceValue()) v = value(f) @@ -369,65 +422,12 @@ func genValueInterfaceValue(n *node) func(*frame) reflect.Value { func genValueNode(n *node) func(*frame) reflect.Value { value := genValue(n) - return func(f *frame) reflect.Value { - return reflect.ValueOf(&node{rval: value(f)}) - } -} - -func genValueRecursiveInterface(n *node, t reflect.Type) func(*frame) reflect.Value { - value := genValue(n) - - return func(f *frame) reflect.Value { - vv := value(f) - v := reflect.New(t).Elem() - toRecursive(v, vv) - return v - } -} - -func toRecursive(dest, src reflect.Value) { - if !src.IsValid() { - return - } - - switch dest.Kind() { - case reflect.Map: - v := reflect.MakeMapWithSize(dest.Type(), src.Len()) - for _, kv := range src.MapKeys() { - vv := reflect.New(dest.Type().Elem()).Elem() - toRecursive(vv, src.MapIndex(kv)) - vv.SetMapIndex(kv, vv) - } - dest.Set(v) - case reflect.Slice: - l := src.Len() - v := reflect.MakeSlice(dest.Type(), l, l) - for i := 0; i < l; i++ { - toRecursive(v.Index(i), src.Index(i)) - } - dest.Set(v) - case reflect.Ptr: - v := reflect.New(dest.Type().Elem()).Elem() - s := src - if s.Elem().Kind() != reflect.Struct { // In the case of *interface{}, we want *struct{} - s = s.Elem() - } - toRecursive(v, s) - dest.Set(v.Addr()) - default: - dest.Set(src) - } -} - -func genValueRecursiveInterfacePtrValue(n *node) func(*frame) reflect.Value { - value := genValue(n) - return func(f *frame) reflect.Value { v := value(f) - if v.IsZero() { + if _, ok := v.Interface().(*node); ok { return v } - return v.Elem().Elem() + return reflect.ValueOf(&node{rval: v}) } } @@ -436,7 +436,7 @@ func vInt(v reflect.Value) (i int64) { i, _ = constant.Int64Val(constant.ToInt(c)) return i } - switch v.Type().Kind() { + switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: i = v.Int() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -454,7 +454,7 @@ func vUint(v reflect.Value) (i uint64) { i, _ = constant.Uint64Val(constant.ToInt(c)) return i } - switch v.Type().Kind() { + switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: i = uint64(v.Int()) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -474,7 +474,7 @@ func vComplex(v reflect.Value) (c complex128) { img, _ := constant.Float64Val(constant.Imag(c)) return complex(rel, img) } - switch v.Type().Kind() { + switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: c = complex(float64(v.Int()), 0) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -492,7 +492,7 @@ func vFloat(v reflect.Value) (i float64) { i, _ = constant.Float64Val(constant.ToFloat(c)) return i } - switch v.Type().Kind() { + switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: i = float64(v.Int()) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: @@ -597,5 +597,6 @@ func genComplex(n *node) func(*frame) complex128 { func genValueString(n *node) func(*frame) (reflect.Value, string) { value := genValue(n) + return func(f *frame) (reflect.Value, string) { v := value(f); return v, v.String() } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_plan9obj.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_plan9obj.go deleted file mode 100644 index 29ab308..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_plan9obj.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by 'yaegi extract debug/plan9obj'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "debug/plan9obj" - "go/constant" - "go/token" - "reflect" -) - -func init() { - Symbols["debug/plan9obj"] = map[string]reflect.Value{ - // function, constant and variable definitions - "Magic386": reflect.ValueOf(constant.MakeFromLiteral("491", token.INT, 0)), - "Magic64": reflect.ValueOf(constant.MakeFromLiteral("32768", token.INT, 0)), - "MagicAMD64": reflect.ValueOf(constant.MakeFromLiteral("35479", token.INT, 0)), - "MagicARM": reflect.ValueOf(constant.MakeFromLiteral("1607", token.INT, 0)), - "NewFile": reflect.ValueOf(plan9obj.NewFile), - "Open": reflect.ValueOf(plan9obj.Open), - - // type definitions - "File": reflect.ValueOf((*plan9obj.File)(nil)), - "FileHeader": reflect.ValueOf((*plan9obj.FileHeader)(nil)), - "Section": reflect.ValueOf((*plan9obj.Section)(nil)), - "SectionHeader": reflect.ValueOf((*plan9obj.SectionHeader)(nil)), - "Sym": reflect.ValueOf((*plan9obj.Sym)(nil)), - } -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_parser.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_parser.go deleted file mode 100644 index 9312cf0..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_parser.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by 'yaegi extract go/parser'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "go/parser" - "reflect" -) - -func init() { - Symbols["go/parser"] = map[string]reflect.Value{ - // function, constant and variable definitions - "AllErrors": reflect.ValueOf(parser.AllErrors), - "DeclarationErrors": reflect.ValueOf(parser.DeclarationErrors), - "ImportsOnly": reflect.ValueOf(parser.ImportsOnly), - "PackageClauseOnly": reflect.ValueOf(parser.PackageClauseOnly), - "ParseComments": reflect.ValueOf(parser.ParseComments), - "ParseDir": reflect.ValueOf(parser.ParseDir), - "ParseExpr": reflect.ValueOf(parser.ParseExpr), - "ParseExprFrom": reflect.ValueOf(parser.ParseExprFrom), - "ParseFile": reflect.ValueOf(parser.ParseFile), - "SpuriousErrors": reflect.ValueOf(parser.SpuriousErrors), - "Trace": reflect.ValueOf(parser.Trace), - - // type definitions - "Mode": reflect.ValueOf((*parser.Mode)(nil)), - } -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash.go deleted file mode 100644 index 77578e2..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by 'yaegi extract hash'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "hash" - "reflect" -) - -func init() { - Symbols["hash"] = map[string]reflect.Value{ - // type definitions - "Hash": reflect.ValueOf((*hash.Hash)(nil)), - "Hash32": reflect.ValueOf((*hash.Hash32)(nil)), - "Hash64": reflect.ValueOf((*hash.Hash64)(nil)), - - // interface wrapper definitions - "_Hash": reflect.ValueOf((*_hash_Hash)(nil)), - "_Hash32": reflect.ValueOf((*_hash_Hash32)(nil)), - "_Hash64": reflect.ValueOf((*_hash_Hash64)(nil)), - } -} - -// _hash_Hash is an interface wrapper for Hash type -type _hash_Hash struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash) Reset() { W.WReset() } -func (W _hash_Hash) Size() int { return W.WSize() } -func (W _hash_Hash) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash) Write(p []byte) (n int, err error) { return W.WWrite(p) } - -// _hash_Hash32 is an interface wrapper for Hash32 type -type _hash_Hash32 struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WSum32 func() uint32 - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash32) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash32) Reset() { W.WReset() } -func (W _hash_Hash32) Size() int { return W.WSize() } -func (W _hash_Hash32) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash32) Sum32() uint32 { return W.WSum32() } -func (W _hash_Hash32) Write(p []byte) (n int, err error) { return W.WWrite(p) } - -// _hash_Hash64 is an interface wrapper for Hash64 type -type _hash_Hash64 struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WSum64 func() uint64 - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash64) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash64) Reset() { W.WReset() } -func (W _hash_Hash64) Size() int { return W.WSize() } -func (W _hash_Hash64) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash64) Sum64() uint64 { return W.WSum64() } -func (W _hash_Hash64) Write(p []byte) (n int, err error) { return W.WWrite(p) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_draw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_draw.go deleted file mode 100644 index 123c1c6..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_draw.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by 'yaegi extract image/draw'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "image" - "image/color" - "image/draw" - "reflect" -) - -func init() { - Symbols["image/draw"] = map[string]reflect.Value{ - // function, constant and variable definitions - "Draw": reflect.ValueOf(draw.Draw), - "DrawMask": reflect.ValueOf(draw.DrawMask), - "FloydSteinberg": reflect.ValueOf(&draw.FloydSteinberg).Elem(), - "Over": reflect.ValueOf(draw.Over), - "Src": reflect.ValueOf(draw.Src), - - // type definitions - "Drawer": reflect.ValueOf((*draw.Drawer)(nil)), - "Image": reflect.ValueOf((*draw.Image)(nil)), - "Op": reflect.ValueOf((*draw.Op)(nil)), - "Quantizer": reflect.ValueOf((*draw.Quantizer)(nil)), - - // interface wrapper definitions - "_Drawer": reflect.ValueOf((*_image_draw_Drawer)(nil)), - "_Image": reflect.ValueOf((*_image_draw_Image)(nil)), - "_Quantizer": reflect.ValueOf((*_image_draw_Quantizer)(nil)), - } -} - -// _image_draw_Drawer is an interface wrapper for Drawer type -type _image_draw_Drawer struct { - WDraw func(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) -} - -func (W _image_draw_Drawer) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) { - W.WDraw(dst, r, src, sp) -} - -// _image_draw_Image is an interface wrapper for Image type -type _image_draw_Image struct { - WAt func(x int, y int) color.Color - WBounds func() image.Rectangle - WColorModel func() color.Model - WSet func(x int, y int, c color.Color) -} - -func (W _image_draw_Image) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_draw_Image) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_draw_Image) ColorModel() color.Model { return W.WColorModel() } -func (W _image_draw_Image) Set(x int, y int, c color.Color) { W.WSet(x, y, c) } - -// _image_draw_Quantizer is an interface wrapper for Quantizer type -type _image_draw_Quantizer struct { - WQuantize func(p color.Palette, m image.Image) color.Palette -} - -func (W _image_draw_Quantizer) Quantize(p color.Palette, m image.Image) color.Palette { - return W.WQuantize(p, m) -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os_signal.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_os_signal.go deleted file mode 100644 index 8fe5b59..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os_signal.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by 'yaegi extract os/signal'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "os/signal" - "reflect" -) - -func init() { - Symbols["os/signal"] = map[string]reflect.Value{ - // function, constant and variable definitions - "Ignore": reflect.ValueOf(signal.Ignore), - "Ignored": reflect.ValueOf(signal.Ignored), - "Notify": reflect.ValueOf(signal.Notify), - "Reset": reflect.ValueOf(signal.Reset), - "Stop": reflect.ValueOf(signal.Stop), - } -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing.go b/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing.go deleted file mode 100644 index 8d07739..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by 'yaegi extract testing'. DO NOT EDIT. - -// +build go1.15,!go1.16 - -package stdlib - -import ( - "reflect" - "testing" -) - -func init() { - Symbols["testing"] = map[string]reflect.Value{ - // function, constant and variable definitions - "AllocsPerRun": reflect.ValueOf(testing.AllocsPerRun), - "Benchmark": reflect.ValueOf(testing.Benchmark), - "CoverMode": reflect.ValueOf(testing.CoverMode), - "Coverage": reflect.ValueOf(testing.Coverage), - "Init": reflect.ValueOf(testing.Init), - "Main": reflect.ValueOf(testing.Main), - "MainStart": reflect.ValueOf(testing.MainStart), - "RegisterCover": reflect.ValueOf(testing.RegisterCover), - "RunBenchmarks": reflect.ValueOf(testing.RunBenchmarks), - "RunExamples": reflect.ValueOf(testing.RunExamples), - "RunTests": reflect.ValueOf(testing.RunTests), - "Short": reflect.ValueOf(testing.Short), - "Verbose": reflect.ValueOf(testing.Verbose), - - // type definitions - "B": reflect.ValueOf((*testing.B)(nil)), - "BenchmarkResult": reflect.ValueOf((*testing.BenchmarkResult)(nil)), - "Cover": reflect.ValueOf((*testing.Cover)(nil)), - "CoverBlock": reflect.ValueOf((*testing.CoverBlock)(nil)), - "InternalBenchmark": reflect.ValueOf((*testing.InternalBenchmark)(nil)), - "InternalExample": reflect.ValueOf((*testing.InternalExample)(nil)), - "InternalTest": reflect.ValueOf((*testing.InternalTest)(nil)), - "M": reflect.ValueOf((*testing.M)(nil)), - "PB": reflect.ValueOf((*testing.PB)(nil)), - "T": reflect.ValueOf((*testing.T)(nil)), - "TB": reflect.ValueOf((*testing.TB)(nil)), - - // interface wrapper definitions - "_TB": reflect.ValueOf((*_testing_TB)(nil)), - } -} - -// _testing_TB is an interface wrapper for TB type -type _testing_TB struct { - WCleanup func(a0 func()) - WError func(args []interface{}) - WErrorf func(format string, args []interface{}) - WFail func() - WFailNow func() - WFailed func() bool - WFatal func(args []interface{}) - WFatalf func(format string, args []interface{}) - WHelper func() - WLog func(args []interface{}) - WLogf func(format string, args []interface{}) - WName func() string - WSkip func(args []interface{}) - WSkipNow func() - WSkipf func(format string, args []interface{}) - WSkipped func() bool - WTempDir func() string -} - -func (W _testing_TB) Cleanup(a0 func()) { W.WCleanup(a0) } -func (W _testing_TB) Error(args []interface{}) { W.WError(args) } -func (W _testing_TB) Errorf(format string, args []interface{}) { W.WErrorf(format, args) } -func (W _testing_TB) Fail() { W.WFail() } -func (W _testing_TB) FailNow() { W.WFailNow() } -func (W _testing_TB) Failed() bool { return W.WFailed() } -func (W _testing_TB) Fatal(args []interface{}) { W.WFatal(args) } -func (W _testing_TB) Fatalf(format string, args []interface{}) { W.WFatalf(format, args) } -func (W _testing_TB) Helper() { W.WHelper() } -func (W _testing_TB) Log(args []interface{}) { W.WLog(args) } -func (W _testing_TB) Logf(format string, args []interface{}) { W.WLogf(format, args) } -func (W _testing_TB) Name() string { return W.WName() } -func (W _testing_TB) Skip(args []interface{}) { W.WSkip(args) } -func (W _testing_TB) SkipNow() { W.WSkipNow() } -func (W _testing_TB) Skipf(format string, args []interface{}) { W.WSkipf(format, args) } -func (W _testing_TB) Skipped() bool { return W.WSkipped() } -func (W _testing_TB) TempDir() string { return W.WTempDir() } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_plan9obj.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_plan9obj.go deleted file mode 100644 index 003b7ed..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_plan9obj.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by 'yaegi extract debug/plan9obj'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "debug/plan9obj" - "go/constant" - "go/token" - "reflect" -) - -func init() { - Symbols["debug/plan9obj"] = map[string]reflect.Value{ - // function, constant and variable definitions - "Magic386": reflect.ValueOf(constant.MakeFromLiteral("491", token.INT, 0)), - "Magic64": reflect.ValueOf(constant.MakeFromLiteral("32768", token.INT, 0)), - "MagicAMD64": reflect.ValueOf(constant.MakeFromLiteral("35479", token.INT, 0)), - "MagicARM": reflect.ValueOf(constant.MakeFromLiteral("1607", token.INT, 0)), - "NewFile": reflect.ValueOf(plan9obj.NewFile), - "Open": reflect.ValueOf(plan9obj.Open), - - // type definitions - "File": reflect.ValueOf((*plan9obj.File)(nil)), - "FileHeader": reflect.ValueOf((*plan9obj.FileHeader)(nil)), - "Section": reflect.ValueOf((*plan9obj.Section)(nil)), - "SectionHeader": reflect.ValueOf((*plan9obj.SectionHeader)(nil)), - "Sym": reflect.ValueOf((*plan9obj.Sym)(nil)), - } -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_binary.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_binary.go deleted file mode 100644 index e944754..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_binary.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by 'yaegi extract encoding/binary'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "encoding/binary" - "go/constant" - "go/token" - "reflect" -) - -func init() { - Symbols["encoding/binary"] = map[string]reflect.Value{ - // function, constant and variable definitions - "BigEndian": reflect.ValueOf(&binary.BigEndian).Elem(), - "LittleEndian": reflect.ValueOf(&binary.LittleEndian).Elem(), - "MaxVarintLen16": reflect.ValueOf(constant.MakeFromLiteral("3", token.INT, 0)), - "MaxVarintLen32": reflect.ValueOf(constant.MakeFromLiteral("5", token.INT, 0)), - "MaxVarintLen64": reflect.ValueOf(constant.MakeFromLiteral("10", token.INT, 0)), - "PutUvarint": reflect.ValueOf(binary.PutUvarint), - "PutVarint": reflect.ValueOf(binary.PutVarint), - "Read": reflect.ValueOf(binary.Read), - "ReadUvarint": reflect.ValueOf(binary.ReadUvarint), - "ReadVarint": reflect.ValueOf(binary.ReadVarint), - "Size": reflect.ValueOf(binary.Size), - "Uvarint": reflect.ValueOf(binary.Uvarint), - "Varint": reflect.ValueOf(binary.Varint), - "Write": reflect.ValueOf(binary.Write), - - // type definitions - "ByteOrder": reflect.ValueOf((*binary.ByteOrder)(nil)), - - // interface wrapper definitions - "_ByteOrder": reflect.ValueOf((*_encoding_binary_ByteOrder)(nil)), - } -} - -// _encoding_binary_ByteOrder is an interface wrapper for ByteOrder type -type _encoding_binary_ByteOrder struct { - WPutUint16 func(a0 []byte, a1 uint16) - WPutUint32 func(a0 []byte, a1 uint32) - WPutUint64 func(a0 []byte, a1 uint64) - WString func() string - WUint16 func(a0 []byte) uint16 - WUint32 func(a0 []byte) uint32 - WUint64 func(a0 []byte) uint64 -} - -func (W _encoding_binary_ByteOrder) PutUint16(a0 []byte, a1 uint16) { W.WPutUint16(a0, a1) } -func (W _encoding_binary_ByteOrder) PutUint32(a0 []byte, a1 uint32) { W.WPutUint32(a0, a1) } -func (W _encoding_binary_ByteOrder) PutUint64(a0 []byte, a1 uint64) { W.WPutUint64(a0, a1) } -func (W _encoding_binary_ByteOrder) String() string { return W.WString() } -func (W _encoding_binary_ByteOrder) Uint16(a0 []byte) uint16 { return W.WUint16(a0) } -func (W _encoding_binary_ByteOrder) Uint32(a0 []byte) uint32 { return W.WUint32(a0) } -func (W _encoding_binary_ByteOrder) Uint64(a0 []byte) uint64 { return W.WUint64(a0) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_parser.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_parser.go deleted file mode 100644 index 5f7759b..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_parser.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by 'yaegi extract go/parser'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "go/parser" - "reflect" -) - -func init() { - Symbols["go/parser"] = map[string]reflect.Value{ - // function, constant and variable definitions - "AllErrors": reflect.ValueOf(parser.AllErrors), - "DeclarationErrors": reflect.ValueOf(parser.DeclarationErrors), - "ImportsOnly": reflect.ValueOf(parser.ImportsOnly), - "PackageClauseOnly": reflect.ValueOf(parser.PackageClauseOnly), - "ParseComments": reflect.ValueOf(parser.ParseComments), - "ParseDir": reflect.ValueOf(parser.ParseDir), - "ParseExpr": reflect.ValueOf(parser.ParseExpr), - "ParseExprFrom": reflect.ValueOf(parser.ParseExprFrom), - "ParseFile": reflect.ValueOf(parser.ParseFile), - "SpuriousErrors": reflect.ValueOf(parser.SpuriousErrors), - "Trace": reflect.ValueOf(parser.Trace), - - // type definitions - "Mode": reflect.ValueOf((*parser.Mode)(nil)), - } -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash.go deleted file mode 100644 index 66830d5..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by 'yaegi extract hash'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "hash" - "reflect" -) - -func init() { - Symbols["hash"] = map[string]reflect.Value{ - // type definitions - "Hash": reflect.ValueOf((*hash.Hash)(nil)), - "Hash32": reflect.ValueOf((*hash.Hash32)(nil)), - "Hash64": reflect.ValueOf((*hash.Hash64)(nil)), - - // interface wrapper definitions - "_Hash": reflect.ValueOf((*_hash_Hash)(nil)), - "_Hash32": reflect.ValueOf((*_hash_Hash32)(nil)), - "_Hash64": reflect.ValueOf((*_hash_Hash64)(nil)), - } -} - -// _hash_Hash is an interface wrapper for Hash type -type _hash_Hash struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash) Reset() { W.WReset() } -func (W _hash_Hash) Size() int { return W.WSize() } -func (W _hash_Hash) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash) Write(p []byte) (n int, err error) { return W.WWrite(p) } - -// _hash_Hash32 is an interface wrapper for Hash32 type -type _hash_Hash32 struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WSum32 func() uint32 - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash32) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash32) Reset() { W.WReset() } -func (W _hash_Hash32) Size() int { return W.WSize() } -func (W _hash_Hash32) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash32) Sum32() uint32 { return W.WSum32() } -func (W _hash_Hash32) Write(p []byte) (n int, err error) { return W.WWrite(p) } - -// _hash_Hash64 is an interface wrapper for Hash64 type -type _hash_Hash64 struct { - WBlockSize func() int - WReset func() - WSize func() int - WSum func(b []byte) []byte - WSum64 func() uint64 - WWrite func(p []byte) (n int, err error) -} - -func (W _hash_Hash64) BlockSize() int { return W.WBlockSize() } -func (W _hash_Hash64) Reset() { W.WReset() } -func (W _hash_Hash64) Size() int { return W.WSize() } -func (W _hash_Hash64) Sum(b []byte) []byte { return W.WSum(b) } -func (W _hash_Hash64) Sum64() uint64 { return W.WSum64() } -func (W _hash_Hash64) Write(p []byte) (n int, err error) { return W.WWrite(p) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_draw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_draw.go deleted file mode 100644 index 52a181c..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_draw.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by 'yaegi extract image/draw'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "image" - "image/color" - "image/draw" - "reflect" -) - -func init() { - Symbols["image/draw"] = map[string]reflect.Value{ - // function, constant and variable definitions - "Draw": reflect.ValueOf(draw.Draw), - "DrawMask": reflect.ValueOf(draw.DrawMask), - "FloydSteinberg": reflect.ValueOf(&draw.FloydSteinberg).Elem(), - "Over": reflect.ValueOf(draw.Over), - "Src": reflect.ValueOf(draw.Src), - - // type definitions - "Drawer": reflect.ValueOf((*draw.Drawer)(nil)), - "Image": reflect.ValueOf((*draw.Image)(nil)), - "Op": reflect.ValueOf((*draw.Op)(nil)), - "Quantizer": reflect.ValueOf((*draw.Quantizer)(nil)), - - // interface wrapper definitions - "_Drawer": reflect.ValueOf((*_image_draw_Drawer)(nil)), - "_Image": reflect.ValueOf((*_image_draw_Image)(nil)), - "_Quantizer": reflect.ValueOf((*_image_draw_Quantizer)(nil)), - } -} - -// _image_draw_Drawer is an interface wrapper for Drawer type -type _image_draw_Drawer struct { - WDraw func(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) -} - -func (W _image_draw_Drawer) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) { - W.WDraw(dst, r, src, sp) -} - -// _image_draw_Image is an interface wrapper for Image type -type _image_draw_Image struct { - WAt func(x int, y int) color.Color - WBounds func() image.Rectangle - WColorModel func() color.Model - WSet func(x int, y int, c color.Color) -} - -func (W _image_draw_Image) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_draw_Image) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_draw_Image) ColorModel() color.Model { return W.WColorModel() } -func (W _image_draw_Image) Set(x int, y int, c color.Color) { W.WSet(x, y, c) } - -// _image_draw_Quantizer is an interface wrapper for Quantizer type -type _image_draw_Quantizer struct { - WQuantize func(p color.Palette, m image.Image) color.Palette -} - -func (W _image_draw_Quantizer) Quantize(p color.Palette, m image.Image) color.Palette { - return W.WQuantize(p, m) -} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing.go b/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing.go deleted file mode 100644 index d1d76da..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by 'yaegi extract testing'. DO NOT EDIT. - -// +build go1.16 - -package stdlib - -import ( - "reflect" - "testing" -) - -func init() { - Symbols["testing"] = map[string]reflect.Value{ - // function, constant and variable definitions - "AllocsPerRun": reflect.ValueOf(testing.AllocsPerRun), - "Benchmark": reflect.ValueOf(testing.Benchmark), - "CoverMode": reflect.ValueOf(testing.CoverMode), - "Coverage": reflect.ValueOf(testing.Coverage), - "Init": reflect.ValueOf(testing.Init), - "Main": reflect.ValueOf(testing.Main), - "MainStart": reflect.ValueOf(testing.MainStart), - "RegisterCover": reflect.ValueOf(testing.RegisterCover), - "RunBenchmarks": reflect.ValueOf(testing.RunBenchmarks), - "RunExamples": reflect.ValueOf(testing.RunExamples), - "RunTests": reflect.ValueOf(testing.RunTests), - "Short": reflect.ValueOf(testing.Short), - "Verbose": reflect.ValueOf(testing.Verbose), - - // type definitions - "B": reflect.ValueOf((*testing.B)(nil)), - "BenchmarkResult": reflect.ValueOf((*testing.BenchmarkResult)(nil)), - "Cover": reflect.ValueOf((*testing.Cover)(nil)), - "CoverBlock": reflect.ValueOf((*testing.CoverBlock)(nil)), - "InternalBenchmark": reflect.ValueOf((*testing.InternalBenchmark)(nil)), - "InternalExample": reflect.ValueOf((*testing.InternalExample)(nil)), - "InternalTest": reflect.ValueOf((*testing.InternalTest)(nil)), - "M": reflect.ValueOf((*testing.M)(nil)), - "PB": reflect.ValueOf((*testing.PB)(nil)), - "T": reflect.ValueOf((*testing.T)(nil)), - "TB": reflect.ValueOf((*testing.TB)(nil)), - - // interface wrapper definitions - "_TB": reflect.ValueOf((*_testing_TB)(nil)), - } -} - -// _testing_TB is an interface wrapper for TB type -type _testing_TB struct { - WCleanup func(a0 func()) - WError func(args []interface{}) - WErrorf func(format string, args []interface{}) - WFail func() - WFailNow func() - WFailed func() bool - WFatal func(args []interface{}) - WFatalf func(format string, args []interface{}) - WHelper func() - WLog func(args []interface{}) - WLogf func(format string, args []interface{}) - WName func() string - WSkip func(args []interface{}) - WSkipNow func() - WSkipf func(format string, args []interface{}) - WSkipped func() bool - WTempDir func() string -} - -func (W _testing_TB) Cleanup(a0 func()) { W.WCleanup(a0) } -func (W _testing_TB) Error(args []interface{}) { W.WError(args) } -func (W _testing_TB) Errorf(format string, args []interface{}) { W.WErrorf(format, args) } -func (W _testing_TB) Fail() { W.WFail() } -func (W _testing_TB) FailNow() { W.WFailNow() } -func (W _testing_TB) Failed() bool { return W.WFailed() } -func (W _testing_TB) Fatal(args []interface{}) { W.WFatal(args) } -func (W _testing_TB) Fatalf(format string, args []interface{}) { W.WFatalf(format, args) } -func (W _testing_TB) Helper() { W.WHelper() } -func (W _testing_TB) Log(args []interface{}) { W.WLog(args) } -func (W _testing_TB) Logf(format string, args []interface{}) { W.WLogf(format, args) } -func (W _testing_TB) Name() string { return W.WName() } -func (W _testing_TB) Skip(args []interface{}) { W.WSkip(args) } -func (W _testing_TB) SkipNow() { W.WSkipNow() } -func (W _testing_TB) Skipf(format string, args []interface{}) { W.WSkipf(format, args) } -func (W _testing_TB) Skipped() bool { return W.WSkipped() } -func (W _testing_TB) TempDir() string { return W.WTempDir() } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_tar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_tar.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_tar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_tar.go index 125f5c1..e097be1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_tar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_tar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract archive/tar'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["archive/tar"] = map[string]reflect.Value{ + Symbols["archive/tar/tar"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrFieldTooLong": reflect.ValueOf(&tar.ErrFieldTooLong).Elem(), "ErrHeader": reflect.ValueOf(&tar.ErrHeader).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_zip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_zip.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_zip.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_zip.go index e522da5..6b82551 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_archive_zip.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_archive_zip.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract archive/zip'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["archive/zip"] = map[string]reflect.Value{ + Symbols["archive/zip/zip"] = map[string]reflect.Value{ // function, constant and variable definitions "Deflate": reflect.ValueOf(zip.Deflate), "ErrAlgorithm": reflect.ValueOf(&zip.ErrAlgorithm).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_bufio.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_bufio.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_bufio.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_bufio.go index f1a4fbc..0213902 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_bufio.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_bufio.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract bufio'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["bufio"] = map[string]reflect.Value{ + Symbols["bufio/bufio"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrAdvanceTooFar": reflect.ValueOf(&bufio.ErrAdvanceTooFar).Elem(), "ErrBadReadCount": reflect.ValueOf(&bufio.ErrBadReadCount).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_bytes.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_bytes.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_bytes.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_bytes.go index 46ae0d5..6d75a6c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_bytes.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_bytes.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract bytes'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,13 +13,14 @@ import ( ) func init() { - Symbols["bytes"] = map[string]reflect.Value{ + Symbols["bytes/bytes"] = map[string]reflect.Value{ // function, constant and variable definitions "Compare": reflect.ValueOf(bytes.Compare), "Contains": reflect.ValueOf(bytes.Contains), "ContainsAny": reflect.ValueOf(bytes.ContainsAny), "ContainsRune": reflect.ValueOf(bytes.ContainsRune), "Count": reflect.ValueOf(bytes.Count), + "Cut": reflect.ValueOf(bytes.Cut), "Equal": reflect.ValueOf(bytes.Equal), "EqualFold": reflect.ValueOf(bytes.EqualFold), "ErrTooLarge": reflect.ValueOf(&bytes.ErrTooLarge).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_bzip2.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_bzip2.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_bzip2.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_bzip2.go index 1d38467..b62263f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_bzip2.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_bzip2.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/bzip2'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["compress/bzip2"] = map[string]reflect.Value{ + Symbols["compress/bzip2/bzip2"] = map[string]reflect.Value{ // function, constant and variable definitions "NewReader": reflect.ValueOf(bzip2.NewReader), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_flate.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_flate.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_flate.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_flate.go index 512b7d3..34363fb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_flate.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_flate.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/flate'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["compress/flate"] = map[string]reflect.Value{ + Symbols["compress/flate/flate"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), @@ -42,16 +43,24 @@ func init() { // _compress_flate_Reader is an interface wrapper for Reader type type _compress_flate_Reader struct { + IValue interface{} WRead func(p []byte) (n int, err error) WReadByte func() (byte, error) } -func (W _compress_flate_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _compress_flate_Reader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _compress_flate_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _compress_flate_Reader) ReadByte() (byte, error) { + return W.WReadByte() +} // _compress_flate_Resetter is an interface wrapper for Resetter type type _compress_flate_Resetter struct { + IValue interface{} WReset func(r io.Reader, dict []byte) error } -func (W _compress_flate_Resetter) Reset(r io.Reader, dict []byte) error { return W.WReset(r, dict) } +func (W _compress_flate_Resetter) Reset(r io.Reader, dict []byte) error { + return W.WReset(r, dict) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_gzip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_gzip.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_gzip.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_gzip.go index 1898a3d..c696d6f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_gzip.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_gzip.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/gzip'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["compress/gzip"] = map[string]reflect.Value{ + Symbols["compress/gzip/gzip"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_lzw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_lzw.go similarity index 60% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_lzw.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_lzw.go index 25ef551..f02ef61 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_lzw.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_lzw.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/lzw'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["compress/lzw"] = map[string]reflect.Value{ + Symbols["compress/lzw/lzw"] = map[string]reflect.Value{ // function, constant and variable definitions "LSB": reflect.ValueOf(lzw.LSB), "MSB": reflect.ValueOf(lzw.MSB), @@ -18,6 +19,8 @@ func init() { "NewWriter": reflect.ValueOf(lzw.NewWriter), // type definitions - "Order": reflect.ValueOf((*lzw.Order)(nil)), + "Order": reflect.ValueOf((*lzw.Order)(nil)), + "Reader": reflect.ValueOf((*lzw.Reader)(nil)), + "Writer": reflect.ValueOf((*lzw.Writer)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_zlib.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_zlib.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_zlib.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_zlib.go index 2133a85..cd768fa 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_zlib.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_compress_zlib.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/zlib'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["compress/zlib"] = map[string]reflect.Value{ + Symbols["compress/zlib/zlib"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), @@ -40,7 +41,10 @@ func init() { // _compress_zlib_Resetter is an interface wrapper for Resetter type type _compress_zlib_Resetter struct { + IValue interface{} WReset func(r io.Reader, dict []byte) error } -func (W _compress_zlib_Resetter) Reset(r io.Reader, dict []byte) error { return W.WReset(r, dict) } +func (W _compress_zlib_Resetter) Reset(r io.Reader, dict []byte) error { + return W.WReset(r, dict) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_heap.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_heap.go similarity index 53% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_container_heap.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_container_heap.go index 275f5b0..7ac3579 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_heap.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_heap.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/heap'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/heap"] = map[string]reflect.Value{ + Symbols["container/heap/heap"] = map[string]reflect.Value{ // function, constant and variable definitions "Fix": reflect.ValueOf(heap.Fix), "Init": reflect.ValueOf(heap.Init), @@ -28,15 +29,26 @@ func init() { // _container_heap_Interface is an interface wrapper for Interface type type _container_heap_Interface struct { - WLen func() int - WLess func(i int, j int) bool - WPop func() interface{} - WPush func(x interface{}) - WSwap func(i int, j int) + IValue interface{} + WLen func() int + WLess func(i int, j int) bool + WPop func() any + WPush func(x any) + WSwap func(i int, j int) } -func (W _container_heap_Interface) Len() int { return W.WLen() } -func (W _container_heap_Interface) Less(i int, j int) bool { return W.WLess(i, j) } -func (W _container_heap_Interface) Pop() interface{} { return W.WPop() } -func (W _container_heap_Interface) Push(x interface{}) { W.WPush(x) } -func (W _container_heap_Interface) Swap(i int, j int) { W.WSwap(i, j) } +func (W _container_heap_Interface) Len() int { + return W.WLen() +} +func (W _container_heap_Interface) Less(i int, j int) bool { + return W.WLess(i, j) +} +func (W _container_heap_Interface) Pop() any { + return W.WPop() +} +func (W _container_heap_Interface) Push(x any) { + W.WPush(x) +} +func (W _container_heap_Interface) Swap(i int, j int) { + W.WSwap(i, j) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_list.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_list.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_container_list.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_container_list.go index 196696e..bd351b0 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_list.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_list.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/list'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/list"] = map[string]reflect.Value{ + Symbols["container/list/list"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(list.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_ring.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_ring.go similarity index 72% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_container_ring.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_container_ring.go index 6fe34ad..3d4523e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_container_ring.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_container_ring.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/ring'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/ring"] = map[string]reflect.Value{ + Symbols["container/ring/ring"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(ring.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_context.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_context.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_context.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_context.go index 6220a7c..c313496 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_context.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_context.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract context'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["context"] = map[string]reflect.Value{ + Symbols["context/context"] = map[string]reflect.Value{ // function, constant and variable definitions "Background": reflect.ValueOf(context.Background), "Canceled": reflect.ValueOf(&context.Canceled).Elem(), @@ -33,13 +34,22 @@ func init() { // _context_Context is an interface wrapper for Context type type _context_Context struct { + IValue interface{} WDeadline func() (deadline time.Time, ok bool) WDone func() <-chan struct{} WErr func() error - WValue func(key interface{}) interface{} + WValue func(key any) any } -func (W _context_Context) Deadline() (deadline time.Time, ok bool) { return W.WDeadline() } -func (W _context_Context) Done() <-chan struct{} { return W.WDone() } -func (W _context_Context) Err() error { return W.WErr() } -func (W _context_Context) Value(key interface{}) interface{} { return W.WValue(key) } +func (W _context_Context) Deadline() (deadline time.Time, ok bool) { + return W.WDeadline() +} +func (W _context_Context) Done() <-chan struct{} { + return W.WDone() +} +func (W _context_Context) Err() error { + return W.WErr() +} +func (W _context_Context) Value(key any) any { + return W.WValue(key) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto.go index 2bdbd51..ce27a3f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["crypto"] = map[string]reflect.Value{ + Symbols["crypto/crypto"] = map[string]reflect.Value{ // function, constant and variable definitions "BLAKE2b_256": reflect.ValueOf(crypto.BLAKE2b_256), "BLAKE2b_384": reflect.ValueOf(crypto.BLAKE2b_384), @@ -55,6 +56,7 @@ func init() { // _crypto_Decrypter is an interface wrapper for Decrypter type type _crypto_Decrypter struct { + IValue interface{} WDecrypt func(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) WPublic func() crypto.PublicKey } @@ -62,34 +64,45 @@ type _crypto_Decrypter struct { func (W _crypto_Decrypter) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) { return W.WDecrypt(rand, msg, opts) } -func (W _crypto_Decrypter) Public() crypto.PublicKey { return W.WPublic() } +func (W _crypto_Decrypter) Public() crypto.PublicKey { + return W.WPublic() +} // _crypto_DecrypterOpts is an interface wrapper for DecrypterOpts type type _crypto_DecrypterOpts struct { + IValue interface{} } // _crypto_PrivateKey is an interface wrapper for PrivateKey type type _crypto_PrivateKey struct { + IValue interface{} } // _crypto_PublicKey is an interface wrapper for PublicKey type type _crypto_PublicKey struct { + IValue interface{} } // _crypto_Signer is an interface wrapper for Signer type type _crypto_Signer struct { + IValue interface{} WPublic func() crypto.PublicKey WSign func(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) } -func (W _crypto_Signer) Public() crypto.PublicKey { return W.WPublic() } +func (W _crypto_Signer) Public() crypto.PublicKey { + return W.WPublic() +} func (W _crypto_Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) { return W.WSign(rand, digest, opts) } // _crypto_SignerOpts is an interface wrapper for SignerOpts type type _crypto_SignerOpts struct { + IValue interface{} WHashFunc func() crypto.Hash } -func (W _crypto_SignerOpts) HashFunc() crypto.Hash { return W.WHashFunc() } +func (W _crypto_SignerOpts) HashFunc() crypto.Hash { + return W.WHashFunc() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_aes.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_aes.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_aes.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_aes.go index 92f02ad..ad4b276 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_aes.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_aes.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/aes'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/aes"] = map[string]reflect.Value{ + Symbols["crypto/aes/aes"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("16", token.INT, 0)), "NewCipher": reflect.ValueOf(aes.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_cipher.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_cipher.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_cipher.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_cipher.go index 0bac1d1..47db633 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_cipher.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_cipher.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/cipher'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/cipher"] = map[string]reflect.Value{ + Symbols["crypto/cipher/cipher"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCBCDecrypter": reflect.ValueOf(cipher.NewCBCDecrypter), "NewCBCEncrypter": reflect.ValueOf(cipher.NewCBCEncrypter), @@ -40,44 +41,64 @@ func init() { // _crypto_cipher_AEAD is an interface wrapper for AEAD type type _crypto_cipher_AEAD struct { + IValue interface{} WNonceSize func() int WOpen func(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) WOverhead func() int WSeal func(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte } -func (W _crypto_cipher_AEAD) NonceSize() int { return W.WNonceSize() } +func (W _crypto_cipher_AEAD) NonceSize() int { + return W.WNonceSize() +} func (W _crypto_cipher_AEAD) Open(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) { return W.WOpen(dst, nonce, ciphertext, additionalData) } -func (W _crypto_cipher_AEAD) Overhead() int { return W.WOverhead() } +func (W _crypto_cipher_AEAD) Overhead() int { + return W.WOverhead() +} func (W _crypto_cipher_AEAD) Seal(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte { return W.WSeal(dst, nonce, plaintext, additionalData) } // _crypto_cipher_Block is an interface wrapper for Block type type _crypto_cipher_Block struct { + IValue interface{} WBlockSize func() int WDecrypt func(dst []byte, src []byte) WEncrypt func(dst []byte, src []byte) } -func (W _crypto_cipher_Block) BlockSize() int { return W.WBlockSize() } -func (W _crypto_cipher_Block) Decrypt(dst []byte, src []byte) { W.WDecrypt(dst, src) } -func (W _crypto_cipher_Block) Encrypt(dst []byte, src []byte) { W.WEncrypt(dst, src) } +func (W _crypto_cipher_Block) BlockSize() int { + return W.WBlockSize() +} +func (W _crypto_cipher_Block) Decrypt(dst []byte, src []byte) { + W.WDecrypt(dst, src) +} +func (W _crypto_cipher_Block) Encrypt(dst []byte, src []byte) { + W.WEncrypt(dst, src) +} // _crypto_cipher_BlockMode is an interface wrapper for BlockMode type type _crypto_cipher_BlockMode struct { + IValue interface{} WBlockSize func() int WCryptBlocks func(dst []byte, src []byte) } -func (W _crypto_cipher_BlockMode) BlockSize() int { return W.WBlockSize() } -func (W _crypto_cipher_BlockMode) CryptBlocks(dst []byte, src []byte) { W.WCryptBlocks(dst, src) } +func (W _crypto_cipher_BlockMode) BlockSize() int { + return W.WBlockSize() +} +func (W _crypto_cipher_BlockMode) CryptBlocks(dst []byte, src []byte) { + W.WCryptBlocks(dst, src) +} // _crypto_cipher_Stream is an interface wrapper for Stream type type _crypto_cipher_Stream struct { + IValue interface{} WXORKeyStream func(dst []byte, src []byte) } -func (W _crypto_cipher_Stream) XORKeyStream(dst []byte, src []byte) { W.WXORKeyStream(dst, src) } +func (W _crypto_cipher_Stream) XORKeyStream(dst []byte, src []byte) { + W.WXORKeyStream(dst, src) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_des.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_des.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_des.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_des.go index dc31139..37c5a6b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_des.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_des.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/des'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/des"] = map[string]reflect.Value{ + Symbols["crypto/des/des"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("8", token.INT, 0)), "NewCipher": reflect.ValueOf(des.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_dsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_dsa.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_dsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_dsa.go index d7743ba..fa02214 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_dsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_dsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/dsa'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/dsa"] = map[string]reflect.Value{ + Symbols["crypto/dsa/dsa"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrInvalidPublicKey": reflect.ValueOf(&dsa.ErrInvalidPublicKey).Elem(), "GenerateKey": reflect.ValueOf(dsa.GenerateKey), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ecdsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ecdsa.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ecdsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ecdsa.go index bf6b0d9..76ef4ea 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ecdsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ecdsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/ecdsa'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/ecdsa"] = map[string]reflect.Value{ + Symbols["crypto/ecdsa/ecdsa"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(ecdsa.GenerateKey), "Sign": reflect.ValueOf(ecdsa.Sign), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ed25519.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ed25519.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ed25519.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ed25519.go index 3da5f4c..e198858 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ed25519.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_ed25519.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/ed25519'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/ed25519"] = map[string]reflect.Value{ + Symbols["crypto/ed25519/ed25519"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(ed25519.GenerateKey), "NewKeyFromSeed": reflect.ValueOf(ed25519.NewKeyFromSeed), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_elliptic.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_elliptic.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_elliptic.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_elliptic.go index fa6ce5a..987b302 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_elliptic.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_elliptic.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/elliptic'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["crypto/elliptic"] = map[string]reflect.Value{ + Symbols["crypto/elliptic/elliptic"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(elliptic.GenerateKey), "Marshal": reflect.ValueOf(elliptic.Marshal), @@ -34,6 +35,7 @@ func init() { // _crypto_elliptic_Curve is an interface wrapper for Curve type type _crypto_elliptic_Curve struct { + IValue interface{} WAdd func(x1 *big.Int, y1 *big.Int, x2 *big.Int, y2 *big.Int) (x *big.Int, y *big.Int) WDouble func(x1 *big.Int, y1 *big.Int) (x *big.Int, y *big.Int) WIsOnCurve func(x *big.Int, y *big.Int) bool @@ -48,8 +50,12 @@ func (W _crypto_elliptic_Curve) Add(x1 *big.Int, y1 *big.Int, x2 *big.Int, y2 *b func (W _crypto_elliptic_Curve) Double(x1 *big.Int, y1 *big.Int) (x *big.Int, y *big.Int) { return W.WDouble(x1, y1) } -func (W _crypto_elliptic_Curve) IsOnCurve(x *big.Int, y *big.Int) bool { return W.WIsOnCurve(x, y) } -func (W _crypto_elliptic_Curve) Params() *elliptic.CurveParams { return W.WParams() } +func (W _crypto_elliptic_Curve) IsOnCurve(x *big.Int, y *big.Int) bool { + return W.WIsOnCurve(x, y) +} +func (W _crypto_elliptic_Curve) Params() *elliptic.CurveParams { + return W.WParams() +} func (W _crypto_elliptic_Curve) ScalarBaseMult(k []byte) (x *big.Int, y *big.Int) { return W.WScalarBaseMult(k) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_hmac.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_hmac.go similarity index 70% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_hmac.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_hmac.go index b67a34b..755d9ed 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_hmac.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_hmac.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/hmac'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/hmac"] = map[string]reflect.Value{ + Symbols["crypto/hmac/hmac"] = map[string]reflect.Value{ // function, constant and variable definitions "Equal": reflect.ValueOf(hmac.Equal), "New": reflect.ValueOf(hmac.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_md5.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_md5.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_md5.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_md5.go index 6b86b79..d2fbd82 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_md5.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_md5.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/md5'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/md5"] = map[string]reflect.Value{ + Symbols["crypto/md5/md5"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(md5.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rand.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rand.go similarity index 76% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rand.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rand.go index 0c09087..1c9095e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rand.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rand.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rand'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/rand"] = map[string]reflect.Value{ + Symbols["crypto/rand/rand"] = map[string]reflect.Value{ // function, constant and variable definitions "Int": reflect.ValueOf(rand.Int), "Prime": reflect.ValueOf(rand.Prime), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rc4.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rc4.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rc4.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rc4.go index 2777e05..e933eaa 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rc4.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rc4.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rc4'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/rc4"] = map[string]reflect.Value{ + Symbols["crypto/rc4/rc4"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCipher": reflect.ValueOf(rc4.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rsa.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rsa.go index b625781..a3ea842 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_rsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rsa'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/rsa"] = map[string]reflect.Value{ + Symbols["crypto/rsa/rsa"] = map[string]reflect.Value{ // function, constant and variable definitions "DecryptOAEP": reflect.ValueOf(rsa.DecryptOAEP), "DecryptPKCS1v15": reflect.ValueOf(rsa.DecryptPKCS1v15), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha1.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha1.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha1.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha1.go index 8c710d8..980ae1c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha1.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha1.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha1'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha1"] = map[string]reflect.Value{ + Symbols["crypto/sha1/sha1"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(sha1.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha256.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha256.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha256.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha256.go index 508ce97..9bb4abb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha256.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha256.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha256'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha256"] = map[string]reflect.Value{ + Symbols["crypto/sha256/sha256"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(sha256.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha512.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha512.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha512.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha512.go index a0c8686..0f2b5f9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha512.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_sha512.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha512'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha512"] = map[string]reflect.Value{ + Symbols["crypto/sha512/sha512"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("128", token.INT, 0)), "New": reflect.ValueOf(sha512.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_subtle.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_subtle.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_subtle.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_subtle.go index 69df53a..ff4f83b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_subtle.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_subtle.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/subtle'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/subtle"] = map[string]reflect.Value{ + Symbols["crypto/subtle/subtle"] = map[string]reflect.Value{ // function, constant and variable definitions "ConstantTimeByteEq": reflect.ValueOf(subtle.ConstantTimeByteEq), "ConstantTimeCompare": reflect.ValueOf(subtle.ConstantTimeCompare), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_tls.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_tls.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_tls.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_tls.go index 4aae4a0..94ab1d3 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_tls.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_tls.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/tls'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/tls"] = map[string]reflect.Value{ + Symbols["crypto/tls/tls"] = map[string]reflect.Value{ // function, constant and variable definitions "CipherSuiteName": reflect.ValueOf(tls.CipherSuiteName), "CipherSuites": reflect.ValueOf(tls.CipherSuites), @@ -108,8 +109,9 @@ func init() { // _crypto_tls_ClientSessionCache is an interface wrapper for ClientSessionCache type type _crypto_tls_ClientSessionCache struct { - WGet func(sessionKey string) (session *tls.ClientSessionState, ok bool) - WPut func(sessionKey string, cs *tls.ClientSessionState) + IValue interface{} + WGet func(sessionKey string) (session *tls.ClientSessionState, ok bool) + WPut func(sessionKey string, cs *tls.ClientSessionState) } func (W _crypto_tls_ClientSessionCache) Get(sessionKey string) (session *tls.ClientSessionState, ok bool) { diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509.go similarity index 98% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509.go index d90250e..b6bc805 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/x509'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/x509"] = map[string]reflect.Value{ + Symbols["crypto/x509/x509"] = map[string]reflect.Value{ // function, constant and variable definitions "CANotAuthorizedForExtKeyUsage": reflect.ValueOf(x509.CANotAuthorizedForExtKeyUsage), "CANotAuthorizedForThisName": reflect.ValueOf(x509.CANotAuthorizedForThisName), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509_pkix.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509_pkix.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509_pkix.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509_pkix.go index 316db98..a272059 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509_pkix.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_crypto_x509_pkix.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/x509/pkix'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/x509/pkix"] = map[string]reflect.Value{ + Symbols["crypto/x509/pkix/pkix"] = map[string]reflect.Value{ // type definitions "AlgorithmIdentifier": reflect.ValueOf((*pkix.AlgorithmIdentifier)(nil)), "AttributeTypeAndValue": reflect.ValueOf((*pkix.AttributeTypeAndValue)(nil)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql.go index 8f0c476..9594b3f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract database/sql'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["database/sql"] = map[string]reflect.Value{ + Symbols["database/sql/sql"] = map[string]reflect.Value{ // function, constant and variable definitions "Drivers": reflect.ValueOf(sql.Drivers), "ErrConnDone": reflect.ValueOf(&sql.ErrConnDone).Elem(), @@ -37,7 +38,9 @@ func init() { "IsolationLevel": reflect.ValueOf((*sql.IsolationLevel)(nil)), "NamedArg": reflect.ValueOf((*sql.NamedArg)(nil)), "NullBool": reflect.ValueOf((*sql.NullBool)(nil)), + "NullByte": reflect.ValueOf((*sql.NullByte)(nil)), "NullFloat64": reflect.ValueOf((*sql.NullFloat64)(nil)), + "NullInt16": reflect.ValueOf((*sql.NullInt16)(nil)), "NullInt32": reflect.ValueOf((*sql.NullInt32)(nil)), "NullInt64": reflect.ValueOf((*sql.NullInt64)(nil)), "NullString": reflect.ValueOf((*sql.NullString)(nil)), @@ -60,16 +63,24 @@ func init() { // _database_sql_Result is an interface wrapper for Result type type _database_sql_Result struct { + IValue interface{} WLastInsertId func() (int64, error) WRowsAffected func() (int64, error) } -func (W _database_sql_Result) LastInsertId() (int64, error) { return W.WLastInsertId() } -func (W _database_sql_Result) RowsAffected() (int64, error) { return W.WRowsAffected() } +func (W _database_sql_Result) LastInsertId() (int64, error) { + return W.WLastInsertId() +} +func (W _database_sql_Result) RowsAffected() (int64, error) { + return W.WRowsAffected() +} // _database_sql_Scanner is an interface wrapper for Scanner type type _database_sql_Scanner struct { - WScan func(src interface{}) error + IValue interface{} + WScan func(src any) error } -func (W _database_sql_Scanner) Scan(src interface{}) error { return W.WScan(src) } +func (W _database_sql_Scanner) Scan(src any) error { + return W.WScan(src) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql_driver.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql_driver.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql_driver.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql_driver.go index a79d475..b0b7c70 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_database_sql_driver.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_database_sql_driver.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract database/sql/driver'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["database/sql/driver"] = map[string]reflect.Value{ + Symbols["database/sql/driver/driver"] = map[string]reflect.Value{ // function, constant and variable definitions "Bool": reflect.ValueOf(&driver.Bool).Elem(), "DefaultParameterConverter": reflect.ValueOf(&driver.DefaultParameterConverter).Elem(), @@ -98,6 +99,7 @@ func init() { // _database_sql_driver_ColumnConverter is an interface wrapper for ColumnConverter type type _database_sql_driver_ColumnConverter struct { + IValue interface{} WColumnConverter func(idx int) driver.ValueConverter } @@ -107,19 +109,25 @@ func (W _database_sql_driver_ColumnConverter) ColumnConverter(idx int) driver.Va // _database_sql_driver_Conn is an interface wrapper for Conn type type _database_sql_driver_Conn struct { + IValue interface{} WBegin func() (driver.Tx, error) WClose func() error WPrepare func(query string) (driver.Stmt, error) } -func (W _database_sql_driver_Conn) Begin() (driver.Tx, error) { return W.WBegin() } -func (W _database_sql_driver_Conn) Close() error { return W.WClose() } +func (W _database_sql_driver_Conn) Begin() (driver.Tx, error) { + return W.WBegin() +} +func (W _database_sql_driver_Conn) Close() error { + return W.WClose() +} func (W _database_sql_driver_Conn) Prepare(query string) (driver.Stmt, error) { return W.WPrepare(query) } // _database_sql_driver_ConnBeginTx is an interface wrapper for ConnBeginTx type type _database_sql_driver_ConnBeginTx struct { + IValue interface{} WBeginTx func(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) } @@ -129,6 +137,7 @@ func (W _database_sql_driver_ConnBeginTx) BeginTx(ctx context.Context, opts driv // _database_sql_driver_ConnPrepareContext is an interface wrapper for ConnPrepareContext type type _database_sql_driver_ConnPrepareContext struct { + IValue interface{} WPrepareContext func(ctx context.Context, query string) (driver.Stmt, error) } @@ -138,6 +147,7 @@ func (W _database_sql_driver_ConnPrepareContext) PrepareContext(ctx context.Cont // _database_sql_driver_Connector is an interface wrapper for Connector type type _database_sql_driver_Connector struct { + IValue interface{} WConnect func(a0 context.Context) (driver.Conn, error) WDriver func() driver.Driver } @@ -145,17 +155,23 @@ type _database_sql_driver_Connector struct { func (W _database_sql_driver_Connector) Connect(a0 context.Context) (driver.Conn, error) { return W.WConnect(a0) } -func (W _database_sql_driver_Connector) Driver() driver.Driver { return W.WDriver() } +func (W _database_sql_driver_Connector) Driver() driver.Driver { + return W.WDriver() +} // _database_sql_driver_Driver is an interface wrapper for Driver type type _database_sql_driver_Driver struct { - WOpen func(name string) (driver.Conn, error) + IValue interface{} + WOpen func(name string) (driver.Conn, error) } -func (W _database_sql_driver_Driver) Open(name string) (driver.Conn, error) { return W.WOpen(name) } +func (W _database_sql_driver_Driver) Open(name string) (driver.Conn, error) { + return W.WOpen(name) +} // _database_sql_driver_DriverContext is an interface wrapper for DriverContext type type _database_sql_driver_DriverContext struct { + IValue interface{} WOpenConnector func(name string) (driver.Connector, error) } @@ -165,7 +181,8 @@ func (W _database_sql_driver_DriverContext) OpenConnector(name string) (driver.C // _database_sql_driver_Execer is an interface wrapper for Execer type type _database_sql_driver_Execer struct { - WExec func(query string, args []driver.Value) (driver.Result, error) + IValue interface{} + WExec func(query string, args []driver.Value) (driver.Result, error) } func (W _database_sql_driver_Execer) Exec(query string, args []driver.Value) (driver.Result, error) { @@ -174,6 +191,7 @@ func (W _database_sql_driver_Execer) Exec(query string, args []driver.Value) (dr // _database_sql_driver_ExecerContext is an interface wrapper for ExecerContext type type _database_sql_driver_ExecerContext struct { + IValue interface{} WExecContext func(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) } @@ -183,6 +201,7 @@ func (W _database_sql_driver_ExecerContext) ExecContext(ctx context.Context, que // _database_sql_driver_NamedValueChecker is an interface wrapper for NamedValueChecker type type _database_sql_driver_NamedValueChecker struct { + IValue interface{} WCheckNamedValue func(a0 *driver.NamedValue) error } @@ -192,13 +211,17 @@ func (W _database_sql_driver_NamedValueChecker) CheckNamedValue(a0 *driver.Named // _database_sql_driver_Pinger is an interface wrapper for Pinger type type _database_sql_driver_Pinger struct { - WPing func(ctx context.Context) error + IValue interface{} + WPing func(ctx context.Context) error } -func (W _database_sql_driver_Pinger) Ping(ctx context.Context) error { return W.WPing(ctx) } +func (W _database_sql_driver_Pinger) Ping(ctx context.Context) error { + return W.WPing(ctx) +} // _database_sql_driver_Queryer is an interface wrapper for Queryer type type _database_sql_driver_Queryer struct { + IValue interface{} WQuery func(query string, args []driver.Value) (driver.Rows, error) } @@ -208,6 +231,7 @@ func (W _database_sql_driver_Queryer) Query(query string, args []driver.Value) ( // _database_sql_driver_QueryerContext is an interface wrapper for QueryerContext type type _database_sql_driver_QueryerContext struct { + IValue interface{} WQueryContext func(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) } @@ -217,111 +241,149 @@ func (W _database_sql_driver_QueryerContext) QueryContext(ctx context.Context, q // _database_sql_driver_Result is an interface wrapper for Result type type _database_sql_driver_Result struct { + IValue interface{} WLastInsertId func() (int64, error) WRowsAffected func() (int64, error) } -func (W _database_sql_driver_Result) LastInsertId() (int64, error) { return W.WLastInsertId() } -func (W _database_sql_driver_Result) RowsAffected() (int64, error) { return W.WRowsAffected() } +func (W _database_sql_driver_Result) LastInsertId() (int64, error) { + return W.WLastInsertId() +} +func (W _database_sql_driver_Result) RowsAffected() (int64, error) { + return W.WRowsAffected() +} // _database_sql_driver_Rows is an interface wrapper for Rows type type _database_sql_driver_Rows struct { + IValue interface{} WClose func() error WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_Rows) Close() error { return W.WClose() } -func (W _database_sql_driver_Rows) Columns() []string { return W.WColumns() } -func (W _database_sql_driver_Rows) Next(dest []driver.Value) error { return W.WNext(dest) } +func (W _database_sql_driver_Rows) Close() error { + return W.WClose() +} +func (W _database_sql_driver_Rows) Columns() []string { + return W.WColumns() +} +func (W _database_sql_driver_Rows) Next(dest []driver.Value) error { + return W.WNext(dest) +} // _database_sql_driver_RowsColumnTypeDatabaseTypeName is an interface wrapper for RowsColumnTypeDatabaseTypeName type type _database_sql_driver_RowsColumnTypeDatabaseTypeName struct { + IValue interface{} WClose func() error WColumnTypeDatabaseTypeName func(index int) string WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) ColumnTypeDatabaseTypeName(index int) string { return W.WColumnTypeDatabaseTypeName(index) } -func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeLength is an interface wrapper for RowsColumnTypeLength type type _database_sql_driver_RowsColumnTypeLength struct { + IValue interface{} WClose func() error WColumnTypeLength func(index int) (length int64, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeLength) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeLength) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeLength) ColumnTypeLength(index int) (length int64, ok bool) { return W.WColumnTypeLength(index) } -func (W _database_sql_driver_RowsColumnTypeLength) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeLength) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeLength) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeNullable is an interface wrapper for RowsColumnTypeNullable type type _database_sql_driver_RowsColumnTypeNullable struct { + IValue interface{} WClose func() error WColumnTypeNullable func(index int) (nullable bool, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeNullable) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeNullable) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeNullable) ColumnTypeNullable(index int) (nullable bool, ok bool) { return W.WColumnTypeNullable(index) } -func (W _database_sql_driver_RowsColumnTypeNullable) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeNullable) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeNullable) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypePrecisionScale is an interface wrapper for RowsColumnTypePrecisionScale type type _database_sql_driver_RowsColumnTypePrecisionScale struct { + IValue interface{} WClose func() error WColumnTypePrecisionScale func(index int) (precision int64, scale int64, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypePrecisionScale) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypePrecisionScale) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypePrecisionScale) ColumnTypePrecisionScale(index int) (precision int64, scale int64, ok bool) { return W.WColumnTypePrecisionScale(index) } -func (W _database_sql_driver_RowsColumnTypePrecisionScale) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypePrecisionScale) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypePrecisionScale) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeScanType is an interface wrapper for RowsColumnTypeScanType type type _database_sql_driver_RowsColumnTypeScanType struct { + IValue interface{} WClose func() error WColumnTypeScanType func(index int) reflect.Type WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeScanType) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeScanType) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeScanType) ColumnTypeScanType(index int) reflect.Type { return W.WColumnTypeScanType(index) } -func (W _database_sql_driver_RowsColumnTypeScanType) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeScanType) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeScanType) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsNextResultSet is an interface wrapper for RowsNextResultSet type type _database_sql_driver_RowsNextResultSet struct { + IValue interface{} WClose func() error WColumns func() []string WHasNextResultSet func() bool @@ -329,14 +391,25 @@ type _database_sql_driver_RowsNextResultSet struct { WNextResultSet func() error } -func (W _database_sql_driver_RowsNextResultSet) Close() error { return W.WClose() } -func (W _database_sql_driver_RowsNextResultSet) Columns() []string { return W.WColumns() } -func (W _database_sql_driver_RowsNextResultSet) HasNextResultSet() bool { return W.WHasNextResultSet() } -func (W _database_sql_driver_RowsNextResultSet) Next(dest []driver.Value) error { return W.WNext(dest) } -func (W _database_sql_driver_RowsNextResultSet) NextResultSet() error { return W.WNextResultSet() } +func (W _database_sql_driver_RowsNextResultSet) Close() error { + return W.WClose() +} +func (W _database_sql_driver_RowsNextResultSet) Columns() []string { + return W.WColumns() +} +func (W _database_sql_driver_RowsNextResultSet) HasNextResultSet() bool { + return W.WHasNextResultSet() +} +func (W _database_sql_driver_RowsNextResultSet) Next(dest []driver.Value) error { + return W.WNext(dest) +} +func (W _database_sql_driver_RowsNextResultSet) NextResultSet() error { + return W.WNextResultSet() +} // _database_sql_driver_SessionResetter is an interface wrapper for SessionResetter type type _database_sql_driver_SessionResetter struct { + IValue interface{} WResetSession func(ctx context.Context) error } @@ -346,23 +419,29 @@ func (W _database_sql_driver_SessionResetter) ResetSession(ctx context.Context) // _database_sql_driver_Stmt is an interface wrapper for Stmt type type _database_sql_driver_Stmt struct { + IValue interface{} WClose func() error WExec func(args []driver.Value) (driver.Result, error) WNumInput func() int WQuery func(args []driver.Value) (driver.Rows, error) } -func (W _database_sql_driver_Stmt) Close() error { return W.WClose() } +func (W _database_sql_driver_Stmt) Close() error { + return W.WClose() +} func (W _database_sql_driver_Stmt) Exec(args []driver.Value) (driver.Result, error) { return W.WExec(args) } -func (W _database_sql_driver_Stmt) NumInput() int { return W.WNumInput() } +func (W _database_sql_driver_Stmt) NumInput() int { + return W.WNumInput() +} func (W _database_sql_driver_Stmt) Query(args []driver.Value) (driver.Rows, error) { return W.WQuery(args) } // _database_sql_driver_StmtExecContext is an interface wrapper for StmtExecContext type type _database_sql_driver_StmtExecContext struct { + IValue interface{} WExecContext func(ctx context.Context, args []driver.NamedValue) (driver.Result, error) } @@ -372,6 +451,7 @@ func (W _database_sql_driver_StmtExecContext) ExecContext(ctx context.Context, a // _database_sql_driver_StmtQueryContext is an interface wrapper for StmtQueryContext type type _database_sql_driver_StmtQueryContext struct { + IValue interface{} WQueryContext func(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) } @@ -381,36 +461,49 @@ func (W _database_sql_driver_StmtQueryContext) QueryContext(ctx context.Context, // _database_sql_driver_Tx is an interface wrapper for Tx type type _database_sql_driver_Tx struct { + IValue interface{} WCommit func() error WRollback func() error } -func (W _database_sql_driver_Tx) Commit() error { return W.WCommit() } -func (W _database_sql_driver_Tx) Rollback() error { return W.WRollback() } +func (W _database_sql_driver_Tx) Commit() error { + return W.WCommit() +} +func (W _database_sql_driver_Tx) Rollback() error { + return W.WRollback() +} // _database_sql_driver_Validator is an interface wrapper for Validator type type _database_sql_driver_Validator struct { + IValue interface{} WIsValid func() bool } -func (W _database_sql_driver_Validator) IsValid() bool { return W.WIsValid() } +func (W _database_sql_driver_Validator) IsValid() bool { + return W.WIsValid() +} // _database_sql_driver_Value is an interface wrapper for Value type type _database_sql_driver_Value struct { + IValue interface{} } // _database_sql_driver_ValueConverter is an interface wrapper for ValueConverter type type _database_sql_driver_ValueConverter struct { - WConvertValue func(v interface{}) (driver.Value, error) + IValue interface{} + WConvertValue func(v any) (driver.Value, error) } -func (W _database_sql_driver_ValueConverter) ConvertValue(v interface{}) (driver.Value, error) { +func (W _database_sql_driver_ValueConverter) ConvertValue(v any) (driver.Value, error) { return W.WConvertValue(v) } // _database_sql_driver_Valuer is an interface wrapper for Valuer type type _database_sql_driver_Valuer struct { + IValue interface{} WValue func() (driver.Value, error) } -func (W _database_sql_driver_Valuer) Value() (driver.Value, error) { return W.WValue() } +func (W _database_sql_driver_Valuer) Value() (driver.Value, error) { + return W.WValue() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_buildinfo.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_buildinfo.go new file mode 100644 index 0000000..c9d2d88 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_buildinfo.go @@ -0,0 +1,22 @@ +// Code generated by 'yaegi extract debug/buildinfo'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "debug/buildinfo" + "reflect" +) + +func init() { + Symbols["debug/buildinfo/buildinfo"] = map[string]reflect.Value{ + // function, constant and variable definitions + "Read": reflect.ValueOf(buildinfo.Read), + "ReadFile": reflect.ValueOf(buildinfo.ReadFile), + + // type definitions + "BuildInfo": reflect.ValueOf((*buildinfo.BuildInfo)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_dwarf.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_dwarf.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_dwarf.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_dwarf.go index ea12774..ed8d320 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_dwarf.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_dwarf.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/dwarf'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/dwarf"] = map[string]reflect.Value{ + Symbols["debug/dwarf/dwarf"] = map[string]reflect.Value{ // function, constant and variable definitions "AttrAbstractOrigin": reflect.ValueOf(dwarf.AttrAbstractOrigin), "AttrAccessibility": reflect.ValueOf(dwarf.AttrAccessibility), @@ -271,11 +272,21 @@ func init() { // _debug_dwarf_Type is an interface wrapper for Type type type _debug_dwarf_Type struct { + IValue interface{} WCommon func() *dwarf.CommonType WSize func() int64 WString func() string } -func (W _debug_dwarf_Type) Common() *dwarf.CommonType { return W.WCommon() } -func (W _debug_dwarf_Type) Size() int64 { return W.WSize() } -func (W _debug_dwarf_Type) String() string { return W.WString() } +func (W _debug_dwarf_Type) Common() *dwarf.CommonType { + return W.WCommon() +} +func (W _debug_dwarf_Type) Size() int64 { + return W.WSize() +} +func (W _debug_dwarf_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_elf.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_elf.go similarity index 99% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_elf.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_elf.go index dc88df5..dcfdfe9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_elf.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_elf.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/elf'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["debug/elf"] = map[string]reflect.Value{ + Symbols["debug/elf/elf"] = map[string]reflect.Value{ // function, constant and variable definitions "ARM_MAGIC_TRAMP_NUMBER": reflect.ValueOf(constant.MakeFromLiteral("1543503875", token.INT, 0)), "COMPRESS_HIOS": reflect.ValueOf(elf.COMPRESS_HIOS), @@ -963,6 +964,7 @@ func init() { "R_PPC64_REL24_NOTOC": reflect.ValueOf(elf.R_PPC64_REL24_NOTOC), "R_PPC64_REL32": reflect.ValueOf(elf.R_PPC64_REL32), "R_PPC64_REL64": reflect.ValueOf(elf.R_PPC64_REL64), + "R_PPC64_RELATIVE": reflect.ValueOf(elf.R_PPC64_RELATIVE), "R_PPC64_SECTOFF_DS": reflect.ValueOf(elf.R_PPC64_SECTOFF_DS), "R_PPC64_SECTOFF_LO_DS": reflect.ValueOf(elf.R_PPC64_SECTOFF_LO_DS), "R_PPC64_TLS": reflect.ValueOf(elf.R_PPC64_TLS), @@ -1264,6 +1266,7 @@ func init() { "SHT_LOOS": reflect.ValueOf(elf.SHT_LOOS), "SHT_LOPROC": reflect.ValueOf(elf.SHT_LOPROC), "SHT_LOUSER": reflect.ValueOf(elf.SHT_LOUSER), + "SHT_MIPS_ABIFLAGS": reflect.ValueOf(elf.SHT_MIPS_ABIFLAGS), "SHT_NOBITS": reflect.ValueOf(elf.SHT_NOBITS), "SHT_NOTE": reflect.ValueOf(elf.SHT_NOTE), "SHT_NULL": reflect.ValueOf(elf.SHT_NULL), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_gosym.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_gosym.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_gosym.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_gosym.go index 068178f..b0427c3 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_gosym.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_gosym.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/gosym'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/gosym"] = map[string]reflect.Value{ + Symbols["debug/gosym/gosym"] = map[string]reflect.Value{ // function, constant and variable definitions "NewLineTable": reflect.ValueOf(gosym.NewLineTable), "NewTable": reflect.ValueOf(gosym.NewTable), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_macho.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_macho.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_macho.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_macho.go index d4a03d7..4e19709 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_macho.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_macho.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/macho'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/macho"] = map[string]reflect.Value{ + Symbols["debug/macho/macho"] = map[string]reflect.Value{ // function, constant and variable definitions "ARM64_RELOC_ADDEND": reflect.ValueOf(macho.ARM64_RELOC_ADDEND), "ARM64_RELOC_BRANCH26": reflect.ValueOf(macho.ARM64_RELOC_BRANCH26), @@ -150,7 +151,10 @@ func init() { // _debug_macho_Load is an interface wrapper for Load type type _debug_macho_Load struct { - WRaw func() []byte + IValue interface{} + WRaw func() []byte } -func (W _debug_macho_Load) Raw() []byte { return W.WRaw() } +func (W _debug_macho_Load) Raw() []byte { + return W.WRaw() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_pe.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_pe.go similarity index 98% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_pe.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_pe.go index 46fc2ce..72f6afe 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_pe.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_pe.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/pe'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["debug/pe"] = map[string]reflect.Value{ + Symbols["debug/pe/pe"] = map[string]reflect.Value{ // function, constant and variable definitions "COFFSymbolSize": reflect.ValueOf(constant.MakeFromLiteral("18", token.INT, 0)), "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE": reflect.ValueOf(constant.MakeFromLiteral("7", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_plan9obj.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_plan9obj.go new file mode 100644 index 0000000..f49b69f --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_debug_plan9obj.go @@ -0,0 +1,33 @@ +// Code generated by 'yaegi extract debug/plan9obj'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "debug/plan9obj" + "go/constant" + "go/token" + "reflect" +) + +func init() { + Symbols["debug/plan9obj/plan9obj"] = map[string]reflect.Value{ + // function, constant and variable definitions + "ErrNoSymbols": reflect.ValueOf(&plan9obj.ErrNoSymbols).Elem(), + "Magic386": reflect.ValueOf(constant.MakeFromLiteral("491", token.INT, 0)), + "Magic64": reflect.ValueOf(constant.MakeFromLiteral("32768", token.INT, 0)), + "MagicAMD64": reflect.ValueOf(constant.MakeFromLiteral("35479", token.INT, 0)), + "MagicARM": reflect.ValueOf(constant.MakeFromLiteral("1607", token.INT, 0)), + "NewFile": reflect.ValueOf(plan9obj.NewFile), + "Open": reflect.ValueOf(plan9obj.Open), + + // type definitions + "File": reflect.ValueOf((*plan9obj.File)(nil)), + "FileHeader": reflect.ValueOf((*plan9obj.FileHeader)(nil)), + "Section": reflect.ValueOf((*plan9obj.Section)(nil)), + "SectionHeader": reflect.ValueOf((*plan9obj.SectionHeader)(nil)), + "Sym": reflect.ValueOf((*plan9obj.Sym)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_embed.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_embed.go new file mode 100644 index 0000000..50c6e11 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_embed.go @@ -0,0 +1,18 @@ +// Code generated by 'yaegi extract embed'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "embed" + "reflect" +) + +func init() { + Symbols["embed/embed"] = map[string]reflect.Value{ + // type definitions + "FS": reflect.ValueOf((*embed.FS)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding.go index 8b4fc83..2a75f0e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding"] = map[string]reflect.Value{ + Symbols["encoding/encoding"] = map[string]reflect.Value{ // type definitions "BinaryMarshaler": reflect.ValueOf((*encoding.BinaryMarshaler)(nil)), "BinaryUnmarshaler": reflect.ValueOf((*encoding.BinaryUnmarshaler)(nil)), @@ -27,6 +28,7 @@ func init() { // _encoding_BinaryMarshaler is an interface wrapper for BinaryMarshaler type type _encoding_BinaryMarshaler struct { + IValue interface{} WMarshalBinary func() (data []byte, err error) } @@ -36,6 +38,7 @@ func (W _encoding_BinaryMarshaler) MarshalBinary() (data []byte, err error) { // _encoding_BinaryUnmarshaler is an interface wrapper for BinaryUnmarshaler type type _encoding_BinaryUnmarshaler struct { + IValue interface{} WUnmarshalBinary func(data []byte) error } @@ -45,14 +48,20 @@ func (W _encoding_BinaryUnmarshaler) UnmarshalBinary(data []byte) error { // _encoding_TextMarshaler is an interface wrapper for TextMarshaler type type _encoding_TextMarshaler struct { + IValue interface{} WMarshalText func() (text []byte, err error) } -func (W _encoding_TextMarshaler) MarshalText() (text []byte, err error) { return W.WMarshalText() } +func (W _encoding_TextMarshaler) MarshalText() (text []byte, err error) { + return W.WMarshalText() +} // _encoding_TextUnmarshaler is an interface wrapper for TextUnmarshaler type type _encoding_TextUnmarshaler struct { + IValue interface{} WUnmarshalText func(text []byte) error } -func (W _encoding_TextUnmarshaler) UnmarshalText(text []byte) error { return W.WUnmarshalText(text) } +func (W _encoding_TextUnmarshaler) UnmarshalText(text []byte) error { + return W.WUnmarshalText(text) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_ascii85.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_ascii85.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_ascii85.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_ascii85.go index 36878c3..f126cc8 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_ascii85.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_ascii85.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/ascii85'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/ascii85"] = map[string]reflect.Value{ + Symbols["encoding/ascii85/ascii85"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(ascii85.Decode), "Encode": reflect.ValueOf(ascii85.Encode), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_asn1.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_asn1.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_asn1.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_asn1.go index a42662f..a1568b6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_asn1.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_asn1.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/asn1'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["encoding/asn1"] = map[string]reflect.Value{ + Symbols["encoding/asn1/asn1"] = map[string]reflect.Value{ // function, constant and variable definitions "ClassApplication": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), "ClassContextSpecific": reflect.ValueOf(constant.MakeFromLiteral("2", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base32.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base32.go index d0ec9f0..5bfd91b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/base32'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/base32"] = map[string]reflect.Value{ + Symbols["encoding/base32/base32"] = map[string]reflect.Value{ // function, constant and variable definitions "HexEncoding": reflect.ValueOf(&base32.HexEncoding).Elem(), "NewDecoder": reflect.ValueOf(base32.NewDecoder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base64.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base64.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base64.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base64.go index 74cadfb..51b21d6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_base64.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_base64.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/base64'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/base64"] = map[string]reflect.Value{ + Symbols["encoding/base64/base64"] = map[string]reflect.Value{ // function, constant and variable definitions "NewDecoder": reflect.ValueOf(base64.NewDecoder), "NewEncoder": reflect.ValueOf(base64.NewEncoder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_binary.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_binary.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_binary.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_binary.go index 8c1af0b..c580da0 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_binary.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_binary.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/binary'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["encoding/binary"] = map[string]reflect.Value{ + Symbols["encoding/binary/binary"] = map[string]reflect.Value{ // function, constant and variable definitions "BigEndian": reflect.ValueOf(&binary.BigEndian).Elem(), "LittleEndian": reflect.ValueOf(&binary.LittleEndian).Elem(), @@ -39,6 +40,7 @@ func init() { // _encoding_binary_ByteOrder is an interface wrapper for ByteOrder type type _encoding_binary_ByteOrder struct { + IValue interface{} WPutUint16 func(a0 []byte, a1 uint16) WPutUint32 func(a0 []byte, a1 uint32) WPutUint64 func(a0 []byte, a1 uint64) @@ -48,10 +50,27 @@ type _encoding_binary_ByteOrder struct { WUint64 func(a0 []byte) uint64 } -func (W _encoding_binary_ByteOrder) PutUint16(a0 []byte, a1 uint16) { W.WPutUint16(a0, a1) } -func (W _encoding_binary_ByteOrder) PutUint32(a0 []byte, a1 uint32) { W.WPutUint32(a0, a1) } -func (W _encoding_binary_ByteOrder) PutUint64(a0 []byte, a1 uint64) { W.WPutUint64(a0, a1) } -func (W _encoding_binary_ByteOrder) String() string { return W.WString() } -func (W _encoding_binary_ByteOrder) Uint16(a0 []byte) uint16 { return W.WUint16(a0) } -func (W _encoding_binary_ByteOrder) Uint32(a0 []byte) uint32 { return W.WUint32(a0) } -func (W _encoding_binary_ByteOrder) Uint64(a0 []byte) uint64 { return W.WUint64(a0) } +func (W _encoding_binary_ByteOrder) PutUint16(a0 []byte, a1 uint16) { + W.WPutUint16(a0, a1) +} +func (W _encoding_binary_ByteOrder) PutUint32(a0 []byte, a1 uint32) { + W.WPutUint32(a0, a1) +} +func (W _encoding_binary_ByteOrder) PutUint64(a0 []byte, a1 uint64) { + W.WPutUint64(a0, a1) +} +func (W _encoding_binary_ByteOrder) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _encoding_binary_ByteOrder) Uint16(a0 []byte) uint16 { + return W.WUint16(a0) +} +func (W _encoding_binary_ByteOrder) Uint32(a0 []byte) uint32 { + return W.WUint32(a0) +} +func (W _encoding_binary_ByteOrder) Uint64(a0 []byte) uint64 { + return W.WUint64(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_csv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_csv.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_csv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_csv.go index ee1796d..63f149a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_csv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_csv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/csv'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/csv"] = map[string]reflect.Value{ + Symbols["encoding/csv/csv"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrBareQuote": reflect.ValueOf(&csv.ErrBareQuote).Elem(), "ErrFieldCount": reflect.ValueOf(&csv.ErrFieldCount).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_gob.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_gob.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_gob.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_gob.go index 0e01192..fb4f394 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_gob.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_gob.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/gob'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/gob"] = map[string]reflect.Value{ + Symbols["encoding/gob/gob"] = map[string]reflect.Value{ // function, constant and variable definitions "NewDecoder": reflect.ValueOf(gob.NewDecoder), "NewEncoder": reflect.ValueOf(gob.NewEncoder), @@ -32,14 +33,20 @@ func init() { // _encoding_gob_GobDecoder is an interface wrapper for GobDecoder type type _encoding_gob_GobDecoder struct { + IValue interface{} WGobDecode func(a0 []byte) error } -func (W _encoding_gob_GobDecoder) GobDecode(a0 []byte) error { return W.WGobDecode(a0) } +func (W _encoding_gob_GobDecoder) GobDecode(a0 []byte) error { + return W.WGobDecode(a0) +} // _encoding_gob_GobEncoder is an interface wrapper for GobEncoder type type _encoding_gob_GobEncoder struct { + IValue interface{} WGobEncode func() ([]byte, error) } -func (W _encoding_gob_GobEncoder) GobEncode() ([]byte, error) { return W.WGobEncode() } +func (W _encoding_gob_GobEncoder) GobEncode() ([]byte, error) { + return W.WGobEncode() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_hex.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_hex.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_hex.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_hex.go index f00c070..57f3b4f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_hex.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_hex.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/hex'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/hex"] = map[string]reflect.Value{ + Symbols["encoding/hex/hex"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(hex.Decode), "DecodeString": reflect.ValueOf(hex.DecodeString), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_json.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_json.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_json.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_json.go index 5c3f2aa..f70defd 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_json.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_json.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/json'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/json"] = map[string]reflect.Value{ + Symbols["encoding/json/json"] = map[string]reflect.Value{ // function, constant and variable definitions "Compact": reflect.ValueOf(json.Compact), "HTMLEscape": reflect.ValueOf(json.HTMLEscape), @@ -49,18 +50,25 @@ func init() { // _encoding_json_Marshaler is an interface wrapper for Marshaler type type _encoding_json_Marshaler struct { + IValue interface{} WMarshalJSON func() ([]byte, error) } -func (W _encoding_json_Marshaler) MarshalJSON() ([]byte, error) { return W.WMarshalJSON() } +func (W _encoding_json_Marshaler) MarshalJSON() ([]byte, error) { + return W.WMarshalJSON() +} // _encoding_json_Token is an interface wrapper for Token type type _encoding_json_Token struct { + IValue interface{} } // _encoding_json_Unmarshaler is an interface wrapper for Unmarshaler type type _encoding_json_Unmarshaler struct { + IValue interface{} WUnmarshalJSON func(a0 []byte) error } -func (W _encoding_json_Unmarshaler) UnmarshalJSON(a0 []byte) error { return W.WUnmarshalJSON(a0) } +func (W _encoding_json_Unmarshaler) UnmarshalJSON(a0 []byte) error { + return W.WUnmarshalJSON(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_pem.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_pem.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_pem.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_pem.go index bffbfd3..3c6723a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_pem.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_pem.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/pem'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/pem"] = map[string]reflect.Value{ + Symbols["encoding/pem/pem"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(pem.Decode), "Encode": reflect.ValueOf(pem.Encode), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_xml.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_xml.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_xml.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_xml.go index 88f665f..00b69ac 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_xml.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_encoding_xml.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/xml'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["encoding/xml"] = map[string]reflect.Value{ + Symbols["encoding/xml/xml"] = map[string]reflect.Value{ // function, constant and variable definitions "CopyToken": reflect.ValueOf(xml.CopyToken), "Escape": reflect.ValueOf(xml.Escape), @@ -61,6 +62,7 @@ func init() { // _encoding_xml_Marshaler is an interface wrapper for Marshaler type type _encoding_xml_Marshaler struct { + IValue interface{} WMarshalXML func(e *xml.Encoder, start xml.StartElement) error } @@ -70,6 +72,7 @@ func (W _encoding_xml_Marshaler) MarshalXML(e *xml.Encoder, start xml.StartEleme // _encoding_xml_MarshalerAttr is an interface wrapper for MarshalerAttr type type _encoding_xml_MarshalerAttr struct { + IValue interface{} WMarshalXMLAttr func(name xml.Name) (xml.Attr, error) } @@ -79,17 +82,22 @@ func (W _encoding_xml_MarshalerAttr) MarshalXMLAttr(name xml.Name) (xml.Attr, er // _encoding_xml_Token is an interface wrapper for Token type type _encoding_xml_Token struct { + IValue interface{} } // _encoding_xml_TokenReader is an interface wrapper for TokenReader type type _encoding_xml_TokenReader struct { + IValue interface{} WToken func() (xml.Token, error) } -func (W _encoding_xml_TokenReader) Token() (xml.Token, error) { return W.WToken() } +func (W _encoding_xml_TokenReader) Token() (xml.Token, error) { + return W.WToken() +} // _encoding_xml_Unmarshaler is an interface wrapper for Unmarshaler type type _encoding_xml_Unmarshaler struct { + IValue interface{} WUnmarshalXML func(d *xml.Decoder, start xml.StartElement) error } @@ -99,6 +107,7 @@ func (W _encoding_xml_Unmarshaler) UnmarshalXML(d *xml.Decoder, start xml.StartE // _encoding_xml_UnmarshalerAttr is an interface wrapper for UnmarshalerAttr type type _encoding_xml_UnmarshalerAttr struct { + IValue interface{} WUnmarshalXMLAttr func(attr xml.Attr) error } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_errors.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_errors.go similarity index 76% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_errors.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_errors.go index 35480b9..475855f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_errors.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_errors.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract errors'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["errors"] = map[string]reflect.Value{ + Symbols["errors/errors"] = map[string]reflect.Value{ // function, constant and variable definitions "As": reflect.ValueOf(errors.As), "Is": reflect.ValueOf(errors.Is), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_expvar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_expvar.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_expvar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_expvar.go index a988d81..94c1861 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_expvar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_expvar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract expvar'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["expvar"] = map[string]reflect.Value{ + Symbols["expvar/expvar"] = map[string]reflect.Value{ // function, constant and variable definitions "Do": reflect.ValueOf(expvar.Do), "Get": reflect.ValueOf(expvar.Get), @@ -37,7 +38,13 @@ func init() { // _expvar_Var is an interface wrapper for Var type type _expvar_Var struct { + IValue interface{} WString func() string } -func (W _expvar_Var) String() string { return W.WString() } +func (W _expvar_Var) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_flag.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_flag.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_flag.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_flag.go index 077b7ee..39e012b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_flag.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_flag.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract flag'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["flag"] = map[string]reflect.Value{ + Symbols["flag/flag"] = map[string]reflect.Value{ // function, constant and variable definitions "Arg": reflect.ValueOf(flag.Arg), "Args": reflect.ValueOf(flag.Args), @@ -65,20 +66,38 @@ func init() { // _flag_Getter is an interface wrapper for Getter type type _flag_Getter struct { - WGet func() interface{} + IValue interface{} + WGet func() any WSet func(a0 string) error WString func() string } -func (W _flag_Getter) Get() interface{} { return W.WGet() } -func (W _flag_Getter) Set(a0 string) error { return W.WSet(a0) } -func (W _flag_Getter) String() string { return W.WString() } +func (W _flag_Getter) Get() any { + return W.WGet() +} +func (W _flag_Getter) Set(a0 string) error { + return W.WSet(a0) +} +func (W _flag_Getter) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} // _flag_Value is an interface wrapper for Value type type _flag_Value struct { + IValue interface{} WSet func(a0 string) error WString func() string } -func (W _flag_Value) Set(a0 string) error { return W.WSet(a0) } -func (W _flag_Value) String() string { return W.WString() } +func (W _flag_Value) Set(a0 string) error { + return W.WSet(a0) +} +func (W _flag_Value) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_fmt.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_fmt.go similarity index 72% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_fmt.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_fmt.go index 794eb93..45843cc 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_fmt.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_fmt.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract fmt'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["fmt"] = map[string]reflect.Value{ + Symbols["fmt/fmt"] = map[string]reflect.Value{ // function, constant and variable definitions "Errorf": reflect.ValueOf(fmt.Errorf), "Fprint": reflect.ValueOf(fmt.Fprint), @@ -52,20 +53,27 @@ func init() { // _fmt_Formatter is an interface wrapper for Formatter type type _fmt_Formatter struct { + IValue interface{} WFormat func(f fmt.State, verb rune) } -func (W _fmt_Formatter) Format(f fmt.State, verb rune) { W.WFormat(f, verb) } +func (W _fmt_Formatter) Format(f fmt.State, verb rune) { + W.WFormat(f, verb) +} // _fmt_GoStringer is an interface wrapper for GoStringer type type _fmt_GoStringer struct { + IValue interface{} WGoString func() string } -func (W _fmt_GoStringer) GoString() string { return W.WGoString() } +func (W _fmt_GoStringer) GoString() string { + return W.WGoString() +} // _fmt_ScanState is an interface wrapper for ScanState type type _fmt_ScanState struct { + IValue interface{} WRead func(buf []byte) (n int, err error) WReadRune func() (r rune, size int, err error) WSkipSpace func() @@ -74,38 +82,66 @@ type _fmt_ScanState struct { WWidth func() (wid int, ok bool) } -func (W _fmt_ScanState) Read(buf []byte) (n int, err error) { return W.WRead(buf) } -func (W _fmt_ScanState) ReadRune() (r rune, size int, err error) { return W.WReadRune() } -func (W _fmt_ScanState) SkipSpace() { W.WSkipSpace() } +func (W _fmt_ScanState) Read(buf []byte) (n int, err error) { + return W.WRead(buf) +} +func (W _fmt_ScanState) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} +func (W _fmt_ScanState) SkipSpace() { + W.WSkipSpace() +} func (W _fmt_ScanState) Token(skipSpace bool, f func(rune) bool) (token []byte, err error) { return W.WToken(skipSpace, f) } -func (W _fmt_ScanState) UnreadRune() error { return W.WUnreadRune() } -func (W _fmt_ScanState) Width() (wid int, ok bool) { return W.WWidth() } +func (W _fmt_ScanState) UnreadRune() error { + return W.WUnreadRune() +} +func (W _fmt_ScanState) Width() (wid int, ok bool) { + return W.WWidth() +} // _fmt_Scanner is an interface wrapper for Scanner type type _fmt_Scanner struct { - WScan func(state fmt.ScanState, verb rune) error + IValue interface{} + WScan func(state fmt.ScanState, verb rune) error } -func (W _fmt_Scanner) Scan(state fmt.ScanState, verb rune) error { return W.WScan(state, verb) } +func (W _fmt_Scanner) Scan(state fmt.ScanState, verb rune) error { + return W.WScan(state, verb) +} // _fmt_State is an interface wrapper for State type type _fmt_State struct { + IValue interface{} WFlag func(c int) bool WPrecision func() (prec int, ok bool) WWidth func() (wid int, ok bool) WWrite func(b []byte) (n int, err error) } -func (W _fmt_State) Flag(c int) bool { return W.WFlag(c) } -func (W _fmt_State) Precision() (prec int, ok bool) { return W.WPrecision() } -func (W _fmt_State) Width() (wid int, ok bool) { return W.WWidth() } -func (W _fmt_State) Write(b []byte) (n int, err error) { return W.WWrite(b) } +func (W _fmt_State) Flag(c int) bool { + return W.WFlag(c) +} +func (W _fmt_State) Precision() (prec int, ok bool) { + return W.WPrecision() +} +func (W _fmt_State) Width() (wid int, ok bool) { + return W.WWidth() +} +func (W _fmt_State) Write(b []byte) (n int, err error) { + return W.WWrite(b) +} // _fmt_Stringer is an interface wrapper for Stringer type type _fmt_Stringer struct { + IValue interface{} WString func() string } -func (W _fmt_Stringer) String() string { return W.WString() } +func (W _fmt_Stringer) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_ast.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_ast.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_ast.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_ast.go index 3574f16..d66bd85 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_ast.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_ast.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/ast'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/ast"] = map[string]reflect.Value{ + Symbols["go/ast/ast"] = map[string]reflect.Value{ // function, constant and variable definitions "Bad": reflect.ValueOf(ast.Bad), "Con": reflect.ValueOf(ast.Con), @@ -87,6 +88,7 @@ func init() { "Importer": reflect.ValueOf((*ast.Importer)(nil)), "IncDecStmt": reflect.ValueOf((*ast.IncDecStmt)(nil)), "IndexExpr": reflect.ValueOf((*ast.IndexExpr)(nil)), + "IndexListExpr": reflect.ValueOf((*ast.IndexListExpr)(nil)), "InterfaceType": reflect.ValueOf((*ast.InterfaceType)(nil)), "KeyValueExpr": reflect.ValueOf((*ast.KeyValueExpr)(nil)), "LabeledStmt": reflect.ValueOf((*ast.LabeledStmt)(nil)), @@ -128,52 +130,80 @@ func init() { // _go_ast_Decl is an interface wrapper for Decl type type _go_ast_Decl struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Decl) End() token.Pos { return W.WEnd() } -func (W _go_ast_Decl) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Decl) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Decl) Pos() token.Pos { + return W.WPos() +} // _go_ast_Expr is an interface wrapper for Expr type type _go_ast_Expr struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Expr) End() token.Pos { return W.WEnd() } -func (W _go_ast_Expr) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Expr) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Expr) Pos() token.Pos { + return W.WPos() +} // _go_ast_Node is an interface wrapper for Node type type _go_ast_Node struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Node) End() token.Pos { return W.WEnd() } -func (W _go_ast_Node) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Node) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Node) Pos() token.Pos { + return W.WPos() +} // _go_ast_Spec is an interface wrapper for Spec type type _go_ast_Spec struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Spec) End() token.Pos { return W.WEnd() } -func (W _go_ast_Spec) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Spec) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Spec) Pos() token.Pos { + return W.WPos() +} // _go_ast_Stmt is an interface wrapper for Stmt type type _go_ast_Stmt struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Stmt) End() token.Pos { return W.WEnd() } -func (W _go_ast_Stmt) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Stmt) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Stmt) Pos() token.Pos { + return W.WPos() +} // _go_ast_Visitor is an interface wrapper for Visitor type type _go_ast_Visitor struct { + IValue interface{} WVisit func(node ast.Node) (w ast.Visitor) } -func (W _go_ast_Visitor) Visit(node ast.Node) (w ast.Visitor) { return W.WVisit(node) } +func (W _go_ast_Visitor) Visit(node ast.Node) (w ast.Visitor) { + return W.WVisit(node) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_build.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_build.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build.go index 0baa2d3..b5d4d07 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_build.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/build'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/build"] = map[string]reflect.Value{ + Symbols["go/build/build"] = map[string]reflect.Value{ // function, constant and variable definitions "AllowBinary": reflect.ValueOf(build.AllowBinary), "ArchChar": reflect.ValueOf(build.ArchChar), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build_constraint.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build_constraint.go new file mode 100644 index 0000000..7bd563f --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_build_constraint.go @@ -0,0 +1,49 @@ +// Code generated by 'yaegi extract go/build/constraint'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "go/build/constraint" + "reflect" +) + +func init() { + Symbols["go/build/constraint/constraint"] = map[string]reflect.Value{ + // function, constant and variable definitions + "IsGoBuild": reflect.ValueOf(constraint.IsGoBuild), + "IsPlusBuild": reflect.ValueOf(constraint.IsPlusBuild), + "Parse": reflect.ValueOf(constraint.Parse), + "PlusBuildLines": reflect.ValueOf(constraint.PlusBuildLines), + + // type definitions + "AndExpr": reflect.ValueOf((*constraint.AndExpr)(nil)), + "Expr": reflect.ValueOf((*constraint.Expr)(nil)), + "NotExpr": reflect.ValueOf((*constraint.NotExpr)(nil)), + "OrExpr": reflect.ValueOf((*constraint.OrExpr)(nil)), + "SyntaxError": reflect.ValueOf((*constraint.SyntaxError)(nil)), + "TagExpr": reflect.ValueOf((*constraint.TagExpr)(nil)), + + // interface wrapper definitions + "_Expr": reflect.ValueOf((*_go_build_constraint_Expr)(nil)), + } +} + +// _go_build_constraint_Expr is an interface wrapper for Expr type +type _go_build_constraint_Expr struct { + IValue interface{} + WEval func(ok func(tag string) bool) bool + WString func() string +} + +func (W _go_build_constraint_Expr) Eval(ok func(tag string) bool) bool { + return W.WEval(ok) +} +func (W _go_build_constraint_Expr) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_constant.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_constant.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_constant.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_constant.go index 74b3f6a..0f3118a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_constant.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_constant.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/constant'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/constant"] = map[string]reflect.Value{ + Symbols["go/constant/constant"] = map[string]reflect.Value{ // function, constant and variable definitions "BinaryOp": reflect.ValueOf(constant.BinaryOp), "BitLen": reflect.ValueOf(constant.BitLen), @@ -61,11 +62,21 @@ func init() { // _go_constant_Value is an interface wrapper for Value type type _go_constant_Value struct { + IValue interface{} WExactString func() string WKind func() constant.Kind WString func() string } -func (W _go_constant_Value) ExactString() string { return W.WExactString() } -func (W _go_constant_Value) Kind() constant.Kind { return W.WKind() } -func (W _go_constant_Value) String() string { return W.WString() } +func (W _go_constant_Value) ExactString() string { + return W.WExactString() +} +func (W _go_constant_Value) Kind() constant.Kind { + return W.WKind() +} +func (W _go_constant_Value) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_doc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_doc.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_doc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_doc.go index d8ea9b1..6943e85 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_doc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_doc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/doc'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/doc"] = map[string]reflect.Value{ + Symbols["go/doc/doc"] = map[string]reflect.Value{ // function, constant and variable definitions "AllDecls": reflect.ValueOf(doc.AllDecls), "AllMethods": reflect.ValueOf(doc.AllMethods), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_format.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_format.go similarity index 70% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_format.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_format.go index 9d5aeb7..99af0d9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_format.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_format.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/format'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/format"] = map[string]reflect.Value{ + Symbols["go/format/format"] = map[string]reflect.Value{ // function, constant and variable definitions "Node": reflect.ValueOf(format.Node), "Source": reflect.ValueOf(format.Source), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_importer.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_importer.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_importer.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_importer.go index 368d071..2a6f242 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_importer.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_importer.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/importer'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/importer"] = map[string]reflect.Value{ + Symbols["go/importer/importer"] = map[string]reflect.Value{ // function, constant and variable definitions "Default": reflect.ValueOf(importer.Default), "For": reflect.ValueOf(importer.For), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_parser.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_parser.go new file mode 100644 index 0000000..c017dbc --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_parser.go @@ -0,0 +1,32 @@ +// Code generated by 'yaegi extract go/parser'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "go/parser" + "reflect" +) + +func init() { + Symbols["go/parser/parser"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AllErrors": reflect.ValueOf(parser.AllErrors), + "DeclarationErrors": reflect.ValueOf(parser.DeclarationErrors), + "ImportsOnly": reflect.ValueOf(parser.ImportsOnly), + "PackageClauseOnly": reflect.ValueOf(parser.PackageClauseOnly), + "ParseComments": reflect.ValueOf(parser.ParseComments), + "ParseDir": reflect.ValueOf(parser.ParseDir), + "ParseExpr": reflect.ValueOf(parser.ParseExpr), + "ParseExprFrom": reflect.ValueOf(parser.ParseExprFrom), + "ParseFile": reflect.ValueOf(parser.ParseFile), + "SkipObjectResolution": reflect.ValueOf(parser.SkipObjectResolution), + "SpuriousErrors": reflect.ValueOf(parser.SpuriousErrors), + "Trace": reflect.ValueOf(parser.Trace), + + // type definitions + "Mode": reflect.ValueOf((*parser.Mode)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_printer.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_printer.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_printer.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_printer.go index 0bc8ec4..aaf269b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_printer.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_printer.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/printer'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/printer"] = map[string]reflect.Value{ + Symbols["go/printer/printer"] = map[string]reflect.Value{ // function, constant and variable definitions "Fprint": reflect.ValueOf(printer.Fprint), "RawFormat": reflect.ValueOf(printer.RawFormat), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_scanner.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_scanner.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_scanner.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_scanner.go index 843df1f..b7a728e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_scanner.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_scanner.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/scanner'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/scanner"] = map[string]reflect.Value{ + Symbols["go/scanner/scanner"] = map[string]reflect.Value{ // function, constant and variable definitions "PrintError": reflect.ValueOf(scanner.PrintError), "ScanComments": reflect.ValueOf(scanner.ScanComments), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_token.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_token.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_token.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_token.go index ccf004b..f3bcd46 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_token.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_token.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/token'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/token"] = map[string]reflect.Value{ + Symbols["go/token/token"] = map[string]reflect.Value{ // function, constant and variable definitions "ADD": reflect.ValueOf(token.ADD), "ADD_ASSIGN": reflect.ValueOf(token.ADD_ASSIGN), @@ -98,6 +99,7 @@ func init() { "SUB": reflect.ValueOf(token.SUB), "SUB_ASSIGN": reflect.ValueOf(token.SUB_ASSIGN), "SWITCH": reflect.ValueOf(token.SWITCH), + "TILDE": reflect.ValueOf(token.TILDE), "TYPE": reflect.ValueOf(token.TYPE), "UnaryPrec": reflect.ValueOf(constant.MakeFromLiteral("6", token.INT, 0)), "VAR": reflect.ValueOf(token.VAR), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_types.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_types.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_types.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_go_types.go index 525ebdb..cd95c58 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_types.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_go_types.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/types'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/types"] = map[string]reflect.Value{ + Symbols["go/types/types"] = map[string]reflect.Value{ // function, constant and variable definitions "AssertableTo": reflect.ValueOf(types.AssertableTo), "AssignableTo": reflect.ValueOf(types.AssignableTo), @@ -33,6 +34,7 @@ func init() { "Identical": reflect.ValueOf(types.Identical), "IdenticalIgnoreTags": reflect.ValueOf(types.IdenticalIgnoreTags), "Implements": reflect.ValueOf(types.Implements), + "Instantiate": reflect.ValueOf(types.Instantiate), "Int": reflect.ValueOf(types.Int), "Int16": reflect.ValueOf(types.Int16), "Int32": reflect.ValueOf(types.Int32), @@ -58,6 +60,7 @@ func init() { "NewChan": reflect.ValueOf(types.NewChan), "NewChecker": reflect.ValueOf(types.NewChecker), "NewConst": reflect.ValueOf(types.NewConst), + "NewContext": reflect.ValueOf(types.NewContext), "NewField": reflect.ValueOf(types.NewField), "NewFunc": reflect.ValueOf(types.NewFunc), "NewInterface": reflect.ValueOf(types.NewInterface), @@ -72,10 +75,14 @@ func init() { "NewPointer": reflect.ValueOf(types.NewPointer), "NewScope": reflect.ValueOf(types.NewScope), "NewSignature": reflect.ValueOf(types.NewSignature), + "NewSignatureType": reflect.ValueOf(types.NewSignatureType), "NewSlice": reflect.ValueOf(types.NewSlice), "NewStruct": reflect.ValueOf(types.NewStruct), + "NewTerm": reflect.ValueOf(types.NewTerm), "NewTuple": reflect.ValueOf(types.NewTuple), "NewTypeName": reflect.ValueOf(types.NewTypeName), + "NewTypeParam": reflect.ValueOf(types.NewTypeParam), + "NewUnion": reflect.ValueOf(types.NewUnion), "NewVar": reflect.ValueOf(types.NewVar), "ObjectString": reflect.ValueOf(types.ObjectString), "RecvOnly": reflect.ValueOf(types.RecvOnly), @@ -109,6 +116,7 @@ func init() { "WriteType": reflect.ValueOf(types.WriteType), // type definitions + "ArgumentError": reflect.ValueOf((*types.ArgumentError)(nil)), "Array": reflect.ValueOf((*types.Array)(nil)), "Basic": reflect.ValueOf((*types.Basic)(nil)), "BasicInfo": reflect.ValueOf((*types.BasicInfo)(nil)), @@ -119,6 +127,7 @@ func init() { "Checker": reflect.ValueOf((*types.Checker)(nil)), "Config": reflect.ValueOf((*types.Config)(nil)), "Const": reflect.ValueOf((*types.Const)(nil)), + "Context": reflect.ValueOf((*types.Context)(nil)), "Error": reflect.ValueOf((*types.Error)(nil)), "Func": reflect.ValueOf((*types.Func)(nil)), "ImportMode": reflect.ValueOf((*types.ImportMode)(nil)), @@ -126,6 +135,7 @@ func init() { "ImporterFrom": reflect.ValueOf((*types.ImporterFrom)(nil)), "Info": reflect.ValueOf((*types.Info)(nil)), "Initializer": reflect.ValueOf((*types.Initializer)(nil)), + "Instance": reflect.ValueOf((*types.Instance)(nil)), "Interface": reflect.ValueOf((*types.Interface)(nil)), "Label": reflect.ValueOf((*types.Label)(nil)), "Map": reflect.ValueOf((*types.Map)(nil)), @@ -145,10 +155,15 @@ func init() { "Slice": reflect.ValueOf((*types.Slice)(nil)), "StdSizes": reflect.ValueOf((*types.StdSizes)(nil)), "Struct": reflect.ValueOf((*types.Struct)(nil)), + "Term": reflect.ValueOf((*types.Term)(nil)), "Tuple": reflect.ValueOf((*types.Tuple)(nil)), "Type": reflect.ValueOf((*types.Type)(nil)), "TypeAndValue": reflect.ValueOf((*types.TypeAndValue)(nil)), + "TypeList": reflect.ValueOf((*types.TypeList)(nil)), "TypeName": reflect.ValueOf((*types.TypeName)(nil)), + "TypeParam": reflect.ValueOf((*types.TypeParam)(nil)), + "TypeParamList": reflect.ValueOf((*types.TypeParamList)(nil)), + "Union": reflect.ValueOf((*types.Union)(nil)), "Var": reflect.ValueOf((*types.Var)(nil)), // interface wrapper definitions @@ -162,24 +177,31 @@ func init() { // _go_types_Importer is an interface wrapper for Importer type type _go_types_Importer struct { + IValue interface{} WImport func(path string) (*types.Package, error) } -func (W _go_types_Importer) Import(path string) (*types.Package, error) { return W.WImport(path) } +func (W _go_types_Importer) Import(path string) (*types.Package, error) { + return W.WImport(path) +} // _go_types_ImporterFrom is an interface wrapper for ImporterFrom type type _go_types_ImporterFrom struct { + IValue interface{} WImport func(path string) (*types.Package, error) WImportFrom func(path string, dir string, mode types.ImportMode) (*types.Package, error) } -func (W _go_types_ImporterFrom) Import(path string) (*types.Package, error) { return W.WImport(path) } +func (W _go_types_ImporterFrom) Import(path string) (*types.Package, error) { + return W.WImport(path) +} func (W _go_types_ImporterFrom) ImportFrom(path string, dir string, mode types.ImportMode) (*types.Package, error) { return W.WImportFrom(path, dir, mode) } // _go_types_Object is an interface wrapper for Object type type _go_types_Object struct { + IValue interface{} WExported func() bool WId func() string WName func() string @@ -190,31 +212,65 @@ type _go_types_Object struct { WType func() types.Type } -func (W _go_types_Object) Exported() bool { return W.WExported() } -func (W _go_types_Object) Id() string { return W.WId() } -func (W _go_types_Object) Name() string { return W.WName() } -func (W _go_types_Object) Parent() *types.Scope { return W.WParent() } -func (W _go_types_Object) Pkg() *types.Package { return W.WPkg() } -func (W _go_types_Object) Pos() token.Pos { return W.WPos() } -func (W _go_types_Object) String() string { return W.WString() } -func (W _go_types_Object) Type() types.Type { return W.WType() } +func (W _go_types_Object) Exported() bool { + return W.WExported() +} +func (W _go_types_Object) Id() string { + return W.WId() +} +func (W _go_types_Object) Name() string { + return W.WName() +} +func (W _go_types_Object) Parent() *types.Scope { + return W.WParent() +} +func (W _go_types_Object) Pkg() *types.Package { + return W.WPkg() +} +func (W _go_types_Object) Pos() token.Pos { + return W.WPos() +} +func (W _go_types_Object) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _go_types_Object) Type() types.Type { + return W.WType() +} // _go_types_Sizes is an interface wrapper for Sizes type type _go_types_Sizes struct { + IValue interface{} WAlignof func(T types.Type) int64 WOffsetsof func(fields []*types.Var) []int64 WSizeof func(T types.Type) int64 } -func (W _go_types_Sizes) Alignof(T types.Type) int64 { return W.WAlignof(T) } -func (W _go_types_Sizes) Offsetsof(fields []*types.Var) []int64 { return W.WOffsetsof(fields) } -func (W _go_types_Sizes) Sizeof(T types.Type) int64 { return W.WSizeof(T) } +func (W _go_types_Sizes) Alignof(T types.Type) int64 { + return W.WAlignof(T) +} +func (W _go_types_Sizes) Offsetsof(fields []*types.Var) []int64 { + return W.WOffsetsof(fields) +} +func (W _go_types_Sizes) Sizeof(T types.Type) int64 { + return W.WSizeof(T) +} // _go_types_Type is an interface wrapper for Type type type _go_types_Type struct { + IValue interface{} WString func() string WUnderlying func() types.Type } -func (W _go_types_Type) String() string { return W.WString() } -func (W _go_types_Type) Underlying() types.Type { return W.WUnderlying() } +func (W _go_types_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _go_types_Type) Underlying() types.Type { + return W.WUnderlying() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash.go new file mode 100644 index 0000000..278d86a --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash.go @@ -0,0 +1,111 @@ +// Code generated by 'yaegi extract hash'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "hash" + "reflect" +) + +func init() { + Symbols["hash/hash"] = map[string]reflect.Value{ + // type definitions + "Hash": reflect.ValueOf((*hash.Hash)(nil)), + "Hash32": reflect.ValueOf((*hash.Hash32)(nil)), + "Hash64": reflect.ValueOf((*hash.Hash64)(nil)), + + // interface wrapper definitions + "_Hash": reflect.ValueOf((*_hash_Hash)(nil)), + "_Hash32": reflect.ValueOf((*_hash_Hash32)(nil)), + "_Hash64": reflect.ValueOf((*_hash_Hash64)(nil)), + } +} + +// _hash_Hash is an interface wrapper for Hash type +type _hash_Hash struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash) Reset() { + W.WReset() +} +func (W _hash_Hash) Size() int { + return W.WSize() +} +func (W _hash_Hash) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} + +// _hash_Hash32 is an interface wrapper for Hash32 type +type _hash_Hash32 struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WSum32 func() uint32 + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash32) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash32) Reset() { + W.WReset() +} +func (W _hash_Hash32) Size() int { + return W.WSize() +} +func (W _hash_Hash32) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash32) Sum32() uint32 { + return W.WSum32() +} +func (W _hash_Hash32) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} + +// _hash_Hash64 is an interface wrapper for Hash64 type +type _hash_Hash64 struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WSum64 func() uint64 + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash64) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash64) Reset() { + W.WReset() +} +func (W _hash_Hash64) Size() int { + return W.WSize() +} +func (W _hash_Hash64) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash64) Sum64() uint64 { + return W.WSum64() +} +func (W _hash_Hash64) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_adler32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_adler32.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_adler32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_adler32.go index 436f899..60854b1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_adler32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_adler32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/adler32'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/adler32"] = map[string]reflect.Value{ + Symbols["hash/adler32/adler32"] = map[string]reflect.Value{ // function, constant and variable definitions "Checksum": reflect.ValueOf(adler32.Checksum), "New": reflect.ValueOf(adler32.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc32.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc32.go index 36d8441..1cd42e5 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/crc32'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/crc32"] = map[string]reflect.Value{ + Symbols["hash/crc32/crc32"] = map[string]reflect.Value{ // function, constant and variable definitions "Castagnoli": reflect.ValueOf(constant.MakeFromLiteral("2197175160", token.INT, 0)), "Checksum": reflect.ValueOf(crc32.Checksum), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc64.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc64.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc64.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc64.go index b2ddd1f..7db8beb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc64.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_crc64.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/crc64'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/crc64"] = map[string]reflect.Value{ + Symbols["hash/crc64/crc64"] = map[string]reflect.Value{ // function, constant and variable definitions "Checksum": reflect.ValueOf(crc64.Checksum), "ECMA": reflect.ValueOf(constant.MakeFromLiteral("14514072000185962306", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_fnv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_fnv.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_fnv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_fnv.go index 55f53de..e5c81b6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_fnv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_fnv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/fnv'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["hash/fnv"] = map[string]reflect.Value{ + Symbols["hash/fnv/fnv"] = map[string]reflect.Value{ // function, constant and variable definitions "New128": reflect.ValueOf(fnv.New128), "New128a": reflect.ValueOf(fnv.New128a), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_maphash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_maphash.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_maphash.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_maphash.go index 0ae671c..4cd84bc 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_maphash.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_hash_maphash.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/maphash'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["hash/maphash"] = map[string]reflect.Value{ + Symbols["hash/maphash/maphash"] = map[string]reflect.Value{ // function, constant and variable definitions "MakeSeed": reflect.ValueOf(maphash.MakeSeed), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_html.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_html.go similarity index 73% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_html.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_html.go index 91d4b88..7b54c77 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_html.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_html.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract html'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["html"] = map[string]reflect.Value{ + Symbols["html/html"] = map[string]reflect.Value{ // function, constant and variable definitions "EscapeString": reflect.ValueOf(html.EscapeString), "UnescapeString": reflect.ValueOf(html.UnescapeString), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_html_template.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_html_template.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_html_template.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_html_template.go index da5346a..32aeec6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_html_template.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_html_template.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract html/template'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["html/template"] = map[string]reflect.Value{ + Symbols["html/template/template"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrAmbigContext": reflect.ValueOf(template.ErrAmbigContext), "ErrBadHTML": reflect.ValueOf(template.ErrBadHTML), @@ -33,6 +34,7 @@ func init() { "Must": reflect.ValueOf(template.Must), "New": reflect.ValueOf(template.New), "OK": reflect.ValueOf(template.OK), + "ParseFS": reflect.ValueOf(template.ParseFS), "ParseFiles": reflect.ValueOf(template.ParseFiles), "ParseGlob": reflect.ValueOf(template.ParseGlob), "URLQueryEscaper": reflect.ValueOf(template.URLQueryEscaper), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image.go index ab66da4..2e6bd8f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["image"] = map[string]reflect.Value{ + Symbols["image/image"] = map[string]reflect.Value{ // function, constant and variable definitions "Black": reflect.ValueOf(&image.Black).Elem(), "Decode": reflect.ValueOf(image.Decode), @@ -61,6 +62,7 @@ func init() { "Point": reflect.ValueOf((*image.Point)(nil)), "RGBA": reflect.ValueOf((*image.RGBA)(nil)), "RGBA64": reflect.ValueOf((*image.RGBA64)(nil)), + "RGBA64Image": reflect.ValueOf((*image.RGBA64Image)(nil)), "Rectangle": reflect.ValueOf((*image.Rectangle)(nil)), "Uniform": reflect.ValueOf((*image.Uniform)(nil)), "YCbCr": reflect.ValueOf((*image.YCbCr)(nil)), @@ -69,29 +71,68 @@ func init() { // interface wrapper definitions "_Image": reflect.ValueOf((*_image_Image)(nil)), "_PalettedImage": reflect.ValueOf((*_image_PalettedImage)(nil)), + "_RGBA64Image": reflect.ValueOf((*_image_RGBA64Image)(nil)), } } // _image_Image is an interface wrapper for Image type type _image_Image struct { + IValue interface{} WAt func(x int, y int) color.Color WBounds func() image.Rectangle WColorModel func() color.Model } -func (W _image_Image) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_Image) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_Image) ColorModel() color.Model { return W.WColorModel() } +func (W _image_Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_Image) ColorModel() color.Model { + return W.WColorModel() +} // _image_PalettedImage is an interface wrapper for PalettedImage type type _image_PalettedImage struct { + IValue interface{} WAt func(x int, y int) color.Color WBounds func() image.Rectangle WColorIndexAt func(x int, y int) uint8 WColorModel func() color.Model } -func (W _image_PalettedImage) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_PalettedImage) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_PalettedImage) ColorIndexAt(x int, y int) uint8 { return W.WColorIndexAt(x, y) } -func (W _image_PalettedImage) ColorModel() color.Model { return W.WColorModel() } +func (W _image_PalettedImage) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_PalettedImage) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_PalettedImage) ColorIndexAt(x int, y int) uint8 { + return W.WColorIndexAt(x, y) +} +func (W _image_PalettedImage) ColorModel() color.Model { + return W.WColorModel() +} + +// _image_RGBA64Image is an interface wrapper for RGBA64Image type +type _image_RGBA64Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WRGBA64At func(x int, y int) color.RGBA64 +} + +func (W _image_RGBA64Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_RGBA64Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_RGBA64Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_RGBA64Image) RGBA64At(x int, y int) color.RGBA64 { + return W.WRGBA64At(x, y) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color.go index 4e38559..e99fdaf 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/color'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/color"] = map[string]reflect.Value{ + Symbols["image/color/color"] = map[string]reflect.Value{ // function, constant and variable definitions "Alpha16Model": reflect.ValueOf(&color.Alpha16Model).Elem(), "AlphaModel": reflect.ValueOf(&color.AlphaModel).Elem(), @@ -57,14 +58,20 @@ func init() { // _image_color_Color is an interface wrapper for Color type type _image_color_Color struct { - WRGBA func() (r uint32, g uint32, b uint32, a uint32) + IValue interface{} + WRGBA func() (r uint32, g uint32, b uint32, a uint32) } -func (W _image_color_Color) RGBA() (r uint32, g uint32, b uint32, a uint32) { return W.WRGBA() } +func (W _image_color_Color) RGBA() (r uint32, g uint32, b uint32, a uint32) { + return W.WRGBA() +} // _image_color_Model is an interface wrapper for Model type type _image_color_Model struct { + IValue interface{} WConvert func(c color.Color) color.Color } -func (W _image_color_Model) Convert(c color.Color) color.Color { return W.WConvert(c) } +func (W _image_color_Model) Convert(c color.Color) color.Color { + return W.WConvert(c) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color_palette.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color_palette.go similarity index 71% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color_palette.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color_palette.go index 40ca4d3..e5a304f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_color_palette.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_color_palette.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/color/palette'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/color/palette"] = map[string]reflect.Value{ + Symbols["image/color/palette/palette"] = map[string]reflect.Value{ // function, constant and variable definitions "Plan9": reflect.ValueOf(&palette.Plan9).Elem(), "WebSafe": reflect.ValueOf(&palette.WebSafe).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_draw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_draw.go new file mode 100644 index 0000000..98d9ffa --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_draw.go @@ -0,0 +1,109 @@ +// Code generated by 'yaegi extract image/draw'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "image" + "image/color" + "image/draw" + "reflect" +) + +func init() { + Symbols["image/draw/draw"] = map[string]reflect.Value{ + // function, constant and variable definitions + "Draw": reflect.ValueOf(draw.Draw), + "DrawMask": reflect.ValueOf(draw.DrawMask), + "FloydSteinberg": reflect.ValueOf(&draw.FloydSteinberg).Elem(), + "Over": reflect.ValueOf(draw.Over), + "Src": reflect.ValueOf(draw.Src), + + // type definitions + "Drawer": reflect.ValueOf((*draw.Drawer)(nil)), + "Image": reflect.ValueOf((*draw.Image)(nil)), + "Op": reflect.ValueOf((*draw.Op)(nil)), + "Quantizer": reflect.ValueOf((*draw.Quantizer)(nil)), + "RGBA64Image": reflect.ValueOf((*draw.RGBA64Image)(nil)), + + // interface wrapper definitions + "_Drawer": reflect.ValueOf((*_image_draw_Drawer)(nil)), + "_Image": reflect.ValueOf((*_image_draw_Image)(nil)), + "_Quantizer": reflect.ValueOf((*_image_draw_Quantizer)(nil)), + "_RGBA64Image": reflect.ValueOf((*_image_draw_RGBA64Image)(nil)), + } +} + +// _image_draw_Drawer is an interface wrapper for Drawer type +type _image_draw_Drawer struct { + IValue interface{} + WDraw func(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) +} + +func (W _image_draw_Drawer) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) { + W.WDraw(dst, r, src, sp) +} + +// _image_draw_Image is an interface wrapper for Image type +type _image_draw_Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WSet func(x int, y int, c color.Color) +} + +func (W _image_draw_Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_draw_Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_draw_Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_draw_Image) Set(x int, y int, c color.Color) { + W.WSet(x, y, c) +} + +// _image_draw_Quantizer is an interface wrapper for Quantizer type +type _image_draw_Quantizer struct { + IValue interface{} + WQuantize func(p color.Palette, m image.Image) color.Palette +} + +func (W _image_draw_Quantizer) Quantize(p color.Palette, m image.Image) color.Palette { + return W.WQuantize(p, m) +} + +// _image_draw_RGBA64Image is an interface wrapper for RGBA64Image type +type _image_draw_RGBA64Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WRGBA64At func(x int, y int) color.RGBA64 + WSet func(x int, y int, c color.Color) + WSetRGBA64 func(x int, y int, c color.RGBA64) +} + +func (W _image_draw_RGBA64Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_draw_RGBA64Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_draw_RGBA64Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_draw_RGBA64Image) RGBA64At(x int, y int) color.RGBA64 { + return W.WRGBA64At(x, y) +} +func (W _image_draw_RGBA64Image) Set(x int, y int, c color.Color) { + W.WSet(x, y, c) +} +func (W _image_draw_RGBA64Image) SetRGBA64(x int, y int, c color.RGBA64) { + W.WSetRGBA64(x, y, c) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_gif.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_gif.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image_gif.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image_gif.go index 6948716..70912f9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_gif.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_gif.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/gif'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["image/gif"] = map[string]reflect.Value{ + Symbols["image/gif/gif"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(gif.Decode), "DecodeAll": reflect.ValueOf(gif.DecodeAll), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_jpeg.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_jpeg.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image_jpeg.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image_jpeg.go index d68af2f..3ddc866 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_jpeg.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_jpeg.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/jpeg'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["image/jpeg"] = map[string]reflect.Value{ + Symbols["image/jpeg/jpeg"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(jpeg.Decode), "DecodeConfig": reflect.ValueOf(jpeg.DecodeConfig), @@ -32,9 +33,14 @@ func init() { // _image_jpeg_Reader is an interface wrapper for Reader type type _image_jpeg_Reader struct { + IValue interface{} WRead func(p []byte) (n int, err error) WReadByte func() (byte, error) } -func (W _image_jpeg_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _image_jpeg_Reader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _image_jpeg_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _image_jpeg_Reader) ReadByte() (byte, error) { + return W.WReadByte() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_png.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_png.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image_png.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_image_png.go index a03414f..2ffb430 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_png.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_image_png.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/png'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/png"] = map[string]reflect.Value{ + Symbols["image/png/png"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(png.BestCompression), "BestSpeed": reflect.ValueOf(png.BestSpeed), @@ -35,9 +36,14 @@ func init() { // _image_png_EncoderBufferPool is an interface wrapper for EncoderBufferPool type type _image_png_EncoderBufferPool struct { - WGet func() *png.EncoderBuffer - WPut func(a0 *png.EncoderBuffer) + IValue interface{} + WGet func() *png.EncoderBuffer + WPut func(a0 *png.EncoderBuffer) } -func (W _image_png_EncoderBufferPool) Get() *png.EncoderBuffer { return W.WGet() } -func (W _image_png_EncoderBufferPool) Put(a0 *png.EncoderBuffer) { W.WPut(a0) } +func (W _image_png_EncoderBufferPool) Get() *png.EncoderBuffer { + return W.WGet() +} +func (W _image_png_EncoderBufferPool) Put(a0 *png.EncoderBuffer) { + W.WPut(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_index_suffixarray.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_index_suffixarray.go similarity index 72% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_index_suffixarray.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_index_suffixarray.go index 18c426a..1fbe85e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_index_suffixarray.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_index_suffixarray.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract index/suffixarray'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["index/suffixarray"] = map[string]reflect.Value{ + Symbols["index/suffixarray/suffixarray"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(suffixarray.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_io.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io.go similarity index 72% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_io.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_io.go index db24be1..05a5fc6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_io.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract io'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,11 +13,12 @@ import ( ) func init() { - Symbols["io"] = map[string]reflect.Value{ + Symbols["io/io"] = map[string]reflect.Value{ // function, constant and variable definitions "Copy": reflect.ValueOf(io.Copy), "CopyBuffer": reflect.ValueOf(io.CopyBuffer), "CopyN": reflect.ValueOf(io.CopyN), + "Discard": reflect.ValueOf(&io.Discard).Elem(), "EOF": reflect.ValueOf(&io.EOF).Elem(), "ErrClosedPipe": reflect.ValueOf(&io.ErrClosedPipe).Elem(), "ErrNoProgress": reflect.ValueOf(&io.ErrNoProgress).Elem(), @@ -27,7 +29,9 @@ func init() { "MultiReader": reflect.ValueOf(io.MultiReader), "MultiWriter": reflect.ValueOf(io.MultiWriter), "NewSectionReader": reflect.ValueOf(io.NewSectionReader), + "NopCloser": reflect.ValueOf(io.NopCloser), "Pipe": reflect.ValueOf(io.Pipe), + "ReadAll": reflect.ValueOf(io.ReadAll), "ReadAtLeast": reflect.ValueOf(io.ReadAtLeast), "ReadFull": reflect.ValueOf(io.ReadFull), "SeekCurrent": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), @@ -45,6 +49,7 @@ func init() { "PipeReader": reflect.ValueOf((*io.PipeReader)(nil)), "PipeWriter": reflect.ValueOf((*io.PipeWriter)(nil)), "ReadCloser": reflect.ValueOf((*io.ReadCloser)(nil)), + "ReadSeekCloser": reflect.ValueOf((*io.ReadSeekCloser)(nil)), "ReadSeeker": reflect.ValueOf((*io.ReadSeeker)(nil)), "ReadWriteCloser": reflect.ValueOf((*io.ReadWriteCloser)(nil)), "ReadWriteSeeker": reflect.ValueOf((*io.ReadWriteSeeker)(nil)), @@ -69,6 +74,7 @@ func init() { "_ByteWriter": reflect.ValueOf((*_io_ByteWriter)(nil)), "_Closer": reflect.ValueOf((*_io_Closer)(nil)), "_ReadCloser": reflect.ValueOf((*_io_ReadCloser)(nil)), + "_ReadSeekCloser": reflect.ValueOf((*_io_ReadSeekCloser)(nil)), "_ReadSeeker": reflect.ValueOf((*_io_ReadSeeker)(nil)), "_ReadWriteCloser": reflect.ValueOf((*_io_ReadWriteCloser)(nil)), "_ReadWriteSeeker": reflect.ValueOf((*_io_ReadWriteSeeker)(nil)), @@ -90,147 +96,235 @@ func init() { // _io_ByteReader is an interface wrapper for ByteReader type type _io_ByteReader struct { + IValue interface{} WReadByte func() (byte, error) } -func (W _io_ByteReader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _io_ByteReader) ReadByte() (byte, error) { + return W.WReadByte() +} // _io_ByteScanner is an interface wrapper for ByteScanner type type _io_ByteScanner struct { + IValue interface{} WReadByte func() (byte, error) WUnreadByte func() error } -func (W _io_ByteScanner) ReadByte() (byte, error) { return W.WReadByte() } -func (W _io_ByteScanner) UnreadByte() error { return W.WUnreadByte() } +func (W _io_ByteScanner) ReadByte() (byte, error) { + return W.WReadByte() +} +func (W _io_ByteScanner) UnreadByte() error { + return W.WUnreadByte() +} // _io_ByteWriter is an interface wrapper for ByteWriter type type _io_ByteWriter struct { + IValue interface{} WWriteByte func(c byte) error } -func (W _io_ByteWriter) WriteByte(c byte) error { return W.WWriteByte(c) } +func (W _io_ByteWriter) WriteByte(c byte) error { + return W.WWriteByte(c) +} // _io_Closer is an interface wrapper for Closer type type _io_Closer struct { + IValue interface{} WClose func() error } -func (W _io_Closer) Close() error { return W.WClose() } +func (W _io_Closer) Close() error { + return W.WClose() +} // _io_ReadCloser is an interface wrapper for ReadCloser type type _io_ReadCloser struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) } -func (W _io_ReadCloser) Close() error { return W.WClose() } -func (W _io_ReadCloser) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_ReadCloser) Close() error { + return W.WClose() +} +func (W _io_ReadCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} + +// _io_ReadSeekCloser is an interface wrapper for ReadSeekCloser type +type _io_ReadSeekCloser struct { + IValue interface{} + WClose func() error + WRead func(p []byte) (n int, err error) + WSeek func(offset int64, whence int) (int64, error) +} + +func (W _io_ReadSeekCloser) Close() error { + return W.WClose() +} +func (W _io_ReadSeekCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadSeekCloser) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} // _io_ReadSeeker is an interface wrapper for ReadSeeker type type _io_ReadSeeker struct { - WRead func(p []byte) (n int, err error) - WSeek func(offset int64, whence int) (int64, error) + IValue interface{} + WRead func(p []byte) (n int, err error) + WSeek func(offset int64, whence int) (int64, error) } -func (W _io_ReadSeeker) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } +func (W _io_ReadSeeker) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadSeeker) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} // _io_ReadWriteCloser is an interface wrapper for ReadWriteCloser type type _io_ReadWriteCloser struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriteCloser) Close() error { return W.WClose() } -func (W _io_ReadWriteCloser) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadWriteCloser) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriteCloser) Close() error { + return W.WClose() +} +func (W _io_ReadWriteCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadWriteCloser) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_ReadWriteSeeker is an interface wrapper for ReadWriteSeeker type type _io_ReadWriteSeeker struct { + IValue interface{} WRead func(p []byte) (n int, err error) WSeek func(offset int64, whence int) (int64, error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriteSeeker) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_ReadWriteSeeker) Read(p []byte) (n int, err error) { + return W.WRead(p) +} func (W _io_ReadWriteSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _io_ReadWriteSeeker) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriteSeeker) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_ReadWriter is an interface wrapper for ReadWriter type type _io_ReadWriter struct { + IValue interface{} WRead func(p []byte) (n int, err error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriter) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadWriter) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriter) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadWriter) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_Reader is an interface wrapper for Reader type type _io_Reader struct { - WRead func(p []byte) (n int, err error) + IValue interface{} + WRead func(p []byte) (n int, err error) } -func (W _io_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} // _io_ReaderAt is an interface wrapper for ReaderAt type type _io_ReaderAt struct { + IValue interface{} WReadAt func(p []byte, off int64) (n int, err error) } -func (W _io_ReaderAt) ReadAt(p []byte, off int64) (n int, err error) { return W.WReadAt(p, off) } +func (W _io_ReaderAt) ReadAt(p []byte, off int64) (n int, err error) { + return W.WReadAt(p, off) +} // _io_ReaderFrom is an interface wrapper for ReaderFrom type type _io_ReaderFrom struct { + IValue interface{} WReadFrom func(r io.Reader) (n int64, err error) } -func (W _io_ReaderFrom) ReadFrom(r io.Reader) (n int64, err error) { return W.WReadFrom(r) } +func (W _io_ReaderFrom) ReadFrom(r io.Reader) (n int64, err error) { + return W.WReadFrom(r) +} // _io_RuneReader is an interface wrapper for RuneReader type type _io_RuneReader struct { + IValue interface{} WReadRune func() (r rune, size int, err error) } -func (W _io_RuneReader) ReadRune() (r rune, size int, err error) { return W.WReadRune() } +func (W _io_RuneReader) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} // _io_RuneScanner is an interface wrapper for RuneScanner type type _io_RuneScanner struct { + IValue interface{} WReadRune func() (r rune, size int, err error) WUnreadRune func() error } -func (W _io_RuneScanner) ReadRune() (r rune, size int, err error) { return W.WReadRune() } -func (W _io_RuneScanner) UnreadRune() error { return W.WUnreadRune() } +func (W _io_RuneScanner) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} +func (W _io_RuneScanner) UnreadRune() error { + return W.WUnreadRune() +} // _io_Seeker is an interface wrapper for Seeker type type _io_Seeker struct { - WSeek func(offset int64, whence int) (int64, error) + IValue interface{} + WSeek func(offset int64, whence int) (int64, error) } -func (W _io_Seeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } +func (W _io_Seeker) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} // _io_StringWriter is an interface wrapper for StringWriter type type _io_StringWriter struct { + IValue interface{} WWriteString func(s string) (n int, err error) } -func (W _io_StringWriter) WriteString(s string) (n int, err error) { return W.WWriteString(s) } +func (W _io_StringWriter) WriteString(s string) (n int, err error) { + return W.WWriteString(s) +} // _io_WriteCloser is an interface wrapper for WriteCloser type type _io_WriteCloser struct { + IValue interface{} WClose func() error WWrite func(p []byte) (n int, err error) } -func (W _io_WriteCloser) Close() error { return W.WClose() } -func (W _io_WriteCloser) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_WriteCloser) Close() error { + return W.WClose() +} +func (W _io_WriteCloser) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_WriteSeeker is an interface wrapper for WriteSeeker type type _io_WriteSeeker struct { + IValue interface{} WSeek func(offset int64, whence int) (int64, error) WWrite func(p []byte) (n int, err error) } @@ -238,25 +332,36 @@ type _io_WriteSeeker struct { func (W _io_WriteSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _io_WriteSeeker) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_WriteSeeker) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_Writer is an interface wrapper for Writer type type _io_Writer struct { + IValue interface{} WWrite func(p []byte) (n int, err error) } -func (W _io_Writer) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_Writer) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_WriterAt is an interface wrapper for WriterAt type type _io_WriterAt struct { + IValue interface{} WWriteAt func(p []byte, off int64) (n int, err error) } -func (W _io_WriterAt) WriteAt(p []byte, off int64) (n int, err error) { return W.WWriteAt(p, off) } +func (W _io_WriterAt) WriteAt(p []byte, off int64) (n int, err error) { + return W.WWriteAt(p, off) +} // _io_WriterTo is an interface wrapper for WriterTo type type _io_WriterTo struct { + IValue interface{} WWriteTo func(w io.Writer) (n int64, err error) } -func (W _io_WriterTo) WriteTo(w io.Writer) (n int64, err error) { return W.WWriteTo(w) } +func (W _io_WriterTo) WriteTo(w io.Writer) (n int64, err error) { + return W.WWriteTo(w) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_io_fs.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io_fs.go new file mode 100644 index 0000000..42c1248 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io_fs.go @@ -0,0 +1,246 @@ +// Code generated by 'yaegi extract io/fs'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "io/fs" + "reflect" + "time" +) + +func init() { + Symbols["io/fs/fs"] = map[string]reflect.Value{ + // function, constant and variable definitions + "ErrClosed": reflect.ValueOf(&fs.ErrClosed).Elem(), + "ErrExist": reflect.ValueOf(&fs.ErrExist).Elem(), + "ErrInvalid": reflect.ValueOf(&fs.ErrInvalid).Elem(), + "ErrNotExist": reflect.ValueOf(&fs.ErrNotExist).Elem(), + "ErrPermission": reflect.ValueOf(&fs.ErrPermission).Elem(), + "FileInfoToDirEntry": reflect.ValueOf(fs.FileInfoToDirEntry), + "Glob": reflect.ValueOf(fs.Glob), + "ModeAppend": reflect.ValueOf(fs.ModeAppend), + "ModeCharDevice": reflect.ValueOf(fs.ModeCharDevice), + "ModeDevice": reflect.ValueOf(fs.ModeDevice), + "ModeDir": reflect.ValueOf(fs.ModeDir), + "ModeExclusive": reflect.ValueOf(fs.ModeExclusive), + "ModeIrregular": reflect.ValueOf(fs.ModeIrregular), + "ModeNamedPipe": reflect.ValueOf(fs.ModeNamedPipe), + "ModePerm": reflect.ValueOf(fs.ModePerm), + "ModeSetgid": reflect.ValueOf(fs.ModeSetgid), + "ModeSetuid": reflect.ValueOf(fs.ModeSetuid), + "ModeSocket": reflect.ValueOf(fs.ModeSocket), + "ModeSticky": reflect.ValueOf(fs.ModeSticky), + "ModeSymlink": reflect.ValueOf(fs.ModeSymlink), + "ModeTemporary": reflect.ValueOf(fs.ModeTemporary), + "ModeType": reflect.ValueOf(fs.ModeType), + "ReadDir": reflect.ValueOf(fs.ReadDir), + "ReadFile": reflect.ValueOf(fs.ReadFile), + "SkipDir": reflect.ValueOf(&fs.SkipDir).Elem(), + "Stat": reflect.ValueOf(fs.Stat), + "Sub": reflect.ValueOf(fs.Sub), + "ValidPath": reflect.ValueOf(fs.ValidPath), + "WalkDir": reflect.ValueOf(fs.WalkDir), + + // type definitions + "DirEntry": reflect.ValueOf((*fs.DirEntry)(nil)), + "FS": reflect.ValueOf((*fs.FS)(nil)), + "File": reflect.ValueOf((*fs.File)(nil)), + "FileInfo": reflect.ValueOf((*fs.FileInfo)(nil)), + "FileMode": reflect.ValueOf((*fs.FileMode)(nil)), + "GlobFS": reflect.ValueOf((*fs.GlobFS)(nil)), + "PathError": reflect.ValueOf((*fs.PathError)(nil)), + "ReadDirFS": reflect.ValueOf((*fs.ReadDirFS)(nil)), + "ReadDirFile": reflect.ValueOf((*fs.ReadDirFile)(nil)), + "ReadFileFS": reflect.ValueOf((*fs.ReadFileFS)(nil)), + "StatFS": reflect.ValueOf((*fs.StatFS)(nil)), + "SubFS": reflect.ValueOf((*fs.SubFS)(nil)), + "WalkDirFunc": reflect.ValueOf((*fs.WalkDirFunc)(nil)), + + // interface wrapper definitions + "_DirEntry": reflect.ValueOf((*_io_fs_DirEntry)(nil)), + "_FS": reflect.ValueOf((*_io_fs_FS)(nil)), + "_File": reflect.ValueOf((*_io_fs_File)(nil)), + "_FileInfo": reflect.ValueOf((*_io_fs_FileInfo)(nil)), + "_GlobFS": reflect.ValueOf((*_io_fs_GlobFS)(nil)), + "_ReadDirFS": reflect.ValueOf((*_io_fs_ReadDirFS)(nil)), + "_ReadDirFile": reflect.ValueOf((*_io_fs_ReadDirFile)(nil)), + "_ReadFileFS": reflect.ValueOf((*_io_fs_ReadFileFS)(nil)), + "_StatFS": reflect.ValueOf((*_io_fs_StatFS)(nil)), + "_SubFS": reflect.ValueOf((*_io_fs_SubFS)(nil)), + } +} + +// _io_fs_DirEntry is an interface wrapper for DirEntry type +type _io_fs_DirEntry struct { + IValue interface{} + WInfo func() (fs.FileInfo, error) + WIsDir func() bool + WName func() string + WType func() fs.FileMode +} + +func (W _io_fs_DirEntry) Info() (fs.FileInfo, error) { + return W.WInfo() +} +func (W _io_fs_DirEntry) IsDir() bool { + return W.WIsDir() +} +func (W _io_fs_DirEntry) Name() string { + return W.WName() +} +func (W _io_fs_DirEntry) Type() fs.FileMode { + return W.WType() +} + +// _io_fs_FS is an interface wrapper for FS type +type _io_fs_FS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) +} + +func (W _io_fs_FS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} + +// _io_fs_File is an interface wrapper for File type +type _io_fs_File struct { + IValue interface{} + WClose func() error + WRead func(a0 []byte) (int, error) + WStat func() (fs.FileInfo, error) +} + +func (W _io_fs_File) Close() error { + return W.WClose() +} +func (W _io_fs_File) Read(a0 []byte) (int, error) { + return W.WRead(a0) +} +func (W _io_fs_File) Stat() (fs.FileInfo, error) { + return W.WStat() +} + +// _io_fs_FileInfo is an interface wrapper for FileInfo type +type _io_fs_FileInfo struct { + IValue interface{} + WIsDir func() bool + WModTime func() time.Time + WMode func() fs.FileMode + WName func() string + WSize func() int64 + WSys func() any +} + +func (W _io_fs_FileInfo) IsDir() bool { + return W.WIsDir() +} +func (W _io_fs_FileInfo) ModTime() time.Time { + return W.WModTime() +} +func (W _io_fs_FileInfo) Mode() fs.FileMode { + return W.WMode() +} +func (W _io_fs_FileInfo) Name() string { + return W.WName() +} +func (W _io_fs_FileInfo) Size() int64 { + return W.WSize() +} +func (W _io_fs_FileInfo) Sys() any { + return W.WSys() +} + +// _io_fs_GlobFS is an interface wrapper for GlobFS type +type _io_fs_GlobFS struct { + IValue interface{} + WGlob func(pattern string) ([]string, error) + WOpen func(name string) (fs.File, error) +} + +func (W _io_fs_GlobFS) Glob(pattern string) ([]string, error) { + return W.WGlob(pattern) +} +func (W _io_fs_GlobFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} + +// _io_fs_ReadDirFS is an interface wrapper for ReadDirFS type +type _io_fs_ReadDirFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WReadDir func(name string) ([]fs.DirEntry, error) +} + +func (W _io_fs_ReadDirFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_ReadDirFS) ReadDir(name string) ([]fs.DirEntry, error) { + return W.WReadDir(name) +} + +// _io_fs_ReadDirFile is an interface wrapper for ReadDirFile type +type _io_fs_ReadDirFile struct { + IValue interface{} + WClose func() error + WRead func(a0 []byte) (int, error) + WReadDir func(n int) ([]fs.DirEntry, error) + WStat func() (fs.FileInfo, error) +} + +func (W _io_fs_ReadDirFile) Close() error { + return W.WClose() +} +func (W _io_fs_ReadDirFile) Read(a0 []byte) (int, error) { + return W.WRead(a0) +} +func (W _io_fs_ReadDirFile) ReadDir(n int) ([]fs.DirEntry, error) { + return W.WReadDir(n) +} +func (W _io_fs_ReadDirFile) Stat() (fs.FileInfo, error) { + return W.WStat() +} + +// _io_fs_ReadFileFS is an interface wrapper for ReadFileFS type +type _io_fs_ReadFileFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WReadFile func(name string) ([]byte, error) +} + +func (W _io_fs_ReadFileFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_ReadFileFS) ReadFile(name string) ([]byte, error) { + return W.WReadFile(name) +} + +// _io_fs_StatFS is an interface wrapper for StatFS type +type _io_fs_StatFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WStat func(name string) (fs.FileInfo, error) +} + +func (W _io_fs_StatFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_StatFS) Stat(name string) (fs.FileInfo, error) { + return W.WStat(name) +} + +// _io_fs_SubFS is an interface wrapper for SubFS type +type _io_fs_SubFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WSub func(dir string) (fs.FS, error) +} + +func (W _io_fs_SubFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_SubFS) Sub(dir string) (fs.FS, error) { + return W.WSub(dir) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_io_ioutil.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io_ioutil.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_io_ioutil.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_io_ioutil.go index 3796b9c..68e367d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_io_ioutil.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_io_ioutil.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract io/ioutil'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["io/ioutil"] = map[string]reflect.Value{ + Symbols["io/ioutil/ioutil"] = map[string]reflect.Value{ // function, constant and variable definitions "Discard": reflect.ValueOf(&ioutil.Discard).Elem(), "NopCloser": reflect.ValueOf(ioutil.NopCloser), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_log.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_log.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_log.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_log.go index 1b8eacc..e23bd89 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_log.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_log.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract log'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,8 +13,9 @@ import ( ) func init() { - Symbols["log"] = map[string]reflect.Value{ + Symbols["log/log"] = map[string]reflect.Value{ // function, constant and variable definitions + "Default": reflect.ValueOf(log.Default), "Fatal": reflect.ValueOf(logFatal), "Fatalf": reflect.ValueOf(logFatalf), "Fatalln": reflect.ValueOf(logFatalln), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_log_syslog.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_log_syslog.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_log_syslog.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_log_syslog.go index 87d6250..7f24a1a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_log_syslog.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_log_syslog.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract log/syslog'. DO NOT EDIT. -// +build go1.16,!windows,!nacl,!plan9 +//go:build go1.18 && !go1.19 && !windows && !nacl && !plan9 +// +build go1.18,!go1.19,!windows,!nacl,!plan9 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["log/syslog"] = map[string]reflect.Value{ + Symbols["log/syslog/syslog"] = map[string]reflect.Value{ // function, constant and variable definitions "Dial": reflect.ValueOf(syslog.Dial), "LOG_ALERT": reflect.ValueOf(syslog.LOG_ALERT), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_math.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_math.go index 4c5bf74..0a97f32 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math"] = map[string]reflect.Value{ + Symbols["math/math"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(math.Abs), "Acos": reflect.ValueOf(math.Acos), @@ -65,16 +66,19 @@ func init() { "Logb": reflect.ValueOf(math.Logb), "Max": reflect.ValueOf(math.Max), "MaxFloat32": reflect.ValueOf(constant.MakeFromLiteral("340282346638528859811704183484516925440", token.FLOAT, 0)), - "MaxFloat64": reflect.ValueOf(constant.MakeFromLiteral("179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", token.FLOAT, 0)), + "MaxFloat64": reflect.ValueOf(constant.MakeFromLiteral("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368", token.FLOAT, 0)), + "MaxInt": reflect.ValueOf(constant.MakeFromLiteral("9223372036854775807", token.INT, 0)), "MaxInt16": reflect.ValueOf(constant.MakeFromLiteral("32767", token.INT, 0)), "MaxInt32": reflect.ValueOf(constant.MakeFromLiteral("2147483647", token.INT, 0)), "MaxInt64": reflect.ValueOf(constant.MakeFromLiteral("9223372036854775807", token.INT, 0)), "MaxInt8": reflect.ValueOf(constant.MakeFromLiteral("127", token.INT, 0)), + "MaxUint": reflect.ValueOf(constant.MakeFromLiteral("18446744073709551615", token.INT, 0)), "MaxUint16": reflect.ValueOf(constant.MakeFromLiteral("65535", token.INT, 0)), "MaxUint32": reflect.ValueOf(constant.MakeFromLiteral("4294967295", token.INT, 0)), "MaxUint64": reflect.ValueOf(constant.MakeFromLiteral("18446744073709551615", token.INT, 0)), "MaxUint8": reflect.ValueOf(constant.MakeFromLiteral("255", token.INT, 0)), "Min": reflect.ValueOf(math.Min), + "MinInt": reflect.ValueOf(constant.MakeFromLiteral("-9223372036854775808", token.INT, 0)), "MinInt16": reflect.ValueOf(constant.MakeFromLiteral("-32768", token.INT, 0)), "MinInt32": reflect.ValueOf(constant.MakeFromLiteral("-2147483648", token.INT, 0)), "MinInt64": reflect.ValueOf(constant.MakeFromLiteral("-9223372036854775808", token.INT, 0)), @@ -95,8 +99,8 @@ func init() { "Sin": reflect.ValueOf(math.Sin), "Sincos": reflect.ValueOf(math.Sincos), "Sinh": reflect.ValueOf(math.Sinh), - "SmallestNonzeroFloat32": reflect.ValueOf(constant.MakeFromLiteral("1.40129846432481707092372958328991613128000000000000000000000000000000000000000000001246655487714533538006789189734126694785975183981128816138510360971472225738624150874949653910667523779981133927289771669016713539217953030564201688027906006008453304556102801950542906382507e-45", token.FLOAT, 0)), - "SmallestNonzeroFloat64": reflect.ValueOf(constant.MakeFromLiteral("4.94065645841246544176568792868221372365099999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999916206614696136086629714037163874026187912451674985660337336755242863513549746484310667379088263176934591818322489862214324814281481943599945502119376688748731948897748561110123901991443297110206447991752071007926740839424145013355231935665542622515363894390826799291671723318261174778903704064716351336223785714389641180220184242018383103204287325861250404139399888498504162666394779407509786431980433771341978183418568838015304951087487907666317075235615216699116844779095660202193409146032665221882798856203896125090454090026556150624798681464913851491093798848436664885581161128190046248588053014958829424991704801027040654863867512297941601850496672190315253109308532379657238854928816482120688440415705411555019932096150435627305446214567713171657554140575630917301482608119551500514805985376055777894871863446222606532650275466165274006e-324", token.FLOAT, 0)), + "SmallestNonzeroFloat32": reflect.ValueOf(constant.MakeFromLiteral("1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45", token.FLOAT, 0)), + "SmallestNonzeroFloat64": reflect.ValueOf(constant.MakeFromLiteral("4.940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625e-324", token.FLOAT, 0)), "Sqrt": reflect.ValueOf(math.Sqrt), "Sqrt2": reflect.ValueOf(constant.MakeFromLiteral("1.414213562373095048801688724209698078569671875376948073176679739576083351575381440094441524123797447886801949755143139115339040409162552642832693297721230919563348109313505318596071447245776653289794921875", token.FLOAT, 0)), "SqrtE": reflect.ValueOf(constant.MakeFromLiteral("1.64872127070012814684865078781416357165377610071014801157507931167328763229187870850146925823776361770041160388013884200789716007979526823569827080974091691342077871211546646890155898290686309337615966796875", token.FLOAT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_big.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_big.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_math_big.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_math_big.go index 348bbd2..f44cbaf 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_big.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_big.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/big'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math/big"] = map[string]reflect.Value{ + Symbols["math/big/big"] = map[string]reflect.Value{ // function, constant and variable definitions "Above": reflect.ValueOf(big.Above), "AwayFromZero": reflect.ValueOf(big.AwayFromZero), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_bits.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_bits.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_math_bits.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_math_bits.go index 3f2296e..bc16868 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_bits.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_bits.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/bits'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math/bits"] = map[string]reflect.Value{ + Symbols["math/bits/bits"] = map[string]reflect.Value{ // function, constant and variable definitions "Add": reflect.ValueOf(bits.Add), "Add32": reflect.ValueOf(bits.Add32), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_cmplx.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_cmplx.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_math_cmplx.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_math_cmplx.go index 80a3dd8..2690b73 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_cmplx.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_cmplx.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/cmplx'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["math/cmplx"] = map[string]reflect.Value{ + Symbols["math/cmplx/cmplx"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(cmplx.Abs), "Acos": reflect.ValueOf(cmplx.Acos), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_rand.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_rand.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_math_rand.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_math_rand.go index ec56a75..a366900 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_rand.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_math_rand.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/rand'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["math/rand"] = map[string]reflect.Value{ + Symbols["math/rand/rand"] = map[string]reflect.Value{ // function, constant and variable definitions "ExpFloat64": reflect.ValueOf(rand.ExpFloat64), "Float32": reflect.ValueOf(rand.Float32), @@ -46,20 +47,32 @@ func init() { // _math_rand_Source is an interface wrapper for Source type type _math_rand_Source struct { + IValue interface{} WInt63 func() int64 WSeed func(seed int64) } -func (W _math_rand_Source) Int63() int64 { return W.WInt63() } -func (W _math_rand_Source) Seed(seed int64) { W.WSeed(seed) } +func (W _math_rand_Source) Int63() int64 { + return W.WInt63() +} +func (W _math_rand_Source) Seed(seed int64) { + W.WSeed(seed) +} // _math_rand_Source64 is an interface wrapper for Source64 type type _math_rand_Source64 struct { + IValue interface{} WInt63 func() int64 WSeed func(seed int64) WUint64 func() uint64 } -func (W _math_rand_Source64) Int63() int64 { return W.WInt63() } -func (W _math_rand_Source64) Seed(seed int64) { W.WSeed(seed) } -func (W _math_rand_Source64) Uint64() uint64 { return W.WUint64() } +func (W _math_rand_Source64) Int63() int64 { + return W.WInt63() +} +func (W _math_rand_Source64) Seed(seed int64) { + W.WSeed(seed) +} +func (W _math_rand_Source64) Uint64() uint64 { + return W.WUint64() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_mime.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_mime.go index f50a118..70b456d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime"] = map[string]reflect.Value{ + Symbols["mime/mime"] = map[string]reflect.Value{ // function, constant and variable definitions "AddExtensionType": reflect.ValueOf(mime.AddExtensionType), "BEncoding": reflect.ValueOf(mime.BEncoding), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_multipart.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_multipart.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_multipart.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_multipart.go index e3501c7..8814877 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_multipart.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_multipart.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime/multipart'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime/multipart"] = map[string]reflect.Value{ + Symbols["mime/multipart/multipart"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrMessageTooLarge": reflect.ValueOf(&multipart.ErrMessageTooLarge).Elem(), "NewReader": reflect.ValueOf(multipart.NewReader), @@ -31,14 +32,19 @@ func init() { // _mime_multipart_File is an interface wrapper for File type type _mime_multipart_File struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WReadAt func(p []byte, off int64) (n int, err error) WSeek func(offset int64, whence int) (int64, error) } -func (W _mime_multipart_File) Close() error { return W.WClose() } -func (W _mime_multipart_File) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _mime_multipart_File) Close() error { + return W.WClose() +} +func (W _mime_multipart_File) Read(p []byte) (n int, err error) { + return W.WRead(p) +} func (W _mime_multipart_File) ReadAt(p []byte, off int64) (n int, err error) { return W.WReadAt(p, off) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_quotedprintable.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_quotedprintable.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_quotedprintable.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_quotedprintable.go index 9b8c08b..264a372 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_quotedprintable.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_mime_quotedprintable.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime/quotedprintable'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime/quotedprintable"] = map[string]reflect.Value{ + Symbols["mime/quotedprintable/quotedprintable"] = map[string]reflect.Value{ // function, constant and variable definitions "NewReader": reflect.ValueOf(quotedprintable.NewReader), "NewWriter": reflect.ValueOf(quotedprintable.NewWriter), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net.go index 2977d9a..b40ddb3 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["net"] = map[string]reflect.Value{ + Symbols["net/net"] = map[string]reflect.Value{ // function, constant and variable definitions "CIDRMask": reflect.ValueOf(net.CIDRMask), "DefaultResolver": reflect.ValueOf(&net.DefaultResolver).Elem(), @@ -23,6 +24,7 @@ func init() { "DialTimeout": reflect.ValueOf(net.DialTimeout), "DialUDP": reflect.ValueOf(net.DialUDP), "DialUnix": reflect.ValueOf(net.DialUnix), + "ErrClosed": reflect.ValueOf(&net.ErrClosed).Elem(), "ErrWriteToConnected": reflect.ValueOf(&net.ErrWriteToConnected).Elem(), "FileConn": reflect.ValueOf(net.FileConn), "FileListener": reflect.ValueOf(net.FileListener), @@ -77,6 +79,8 @@ func init() { "ResolveUDPAddr": reflect.ValueOf(net.ResolveUDPAddr), "ResolveUnixAddr": reflect.ValueOf(net.ResolveUnixAddr), "SplitHostPort": reflect.ValueOf(net.SplitHostPort), + "TCPAddrFromAddrPort": reflect.ValueOf(net.TCPAddrFromAddrPort), + "UDPAddrFromAddrPort": reflect.ValueOf(net.UDPAddrFromAddrPort), // type definitions "Addr": reflect.ValueOf((*net.Addr)(nil)), @@ -126,15 +130,24 @@ func init() { // _net_Addr is an interface wrapper for Addr type type _net_Addr struct { + IValue interface{} WNetwork func() string WString func() string } -func (W _net_Addr) Network() string { return W.WNetwork() } -func (W _net_Addr) String() string { return W.WString() } +func (W _net_Addr) Network() string { + return W.WNetwork() +} +func (W _net_Addr) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} // _net_Conn is an interface wrapper for Conn type type _net_Conn struct { + IValue interface{} WClose func() error WLocalAddr func() net.Addr WRead func(b []byte) (n int, err error) @@ -145,39 +158,70 @@ type _net_Conn struct { WWrite func(b []byte) (n int, err error) } -func (W _net_Conn) Close() error { return W.WClose() } -func (W _net_Conn) LocalAddr() net.Addr { return W.WLocalAddr() } -func (W _net_Conn) Read(b []byte) (n int, err error) { return W.WRead(b) } -func (W _net_Conn) RemoteAddr() net.Addr { return W.WRemoteAddr() } -func (W _net_Conn) SetDeadline(t time.Time) error { return W.WSetDeadline(t) } -func (W _net_Conn) SetReadDeadline(t time.Time) error { return W.WSetReadDeadline(t) } -func (W _net_Conn) SetWriteDeadline(t time.Time) error { return W.WSetWriteDeadline(t) } -func (W _net_Conn) Write(b []byte) (n int, err error) { return W.WWrite(b) } +func (W _net_Conn) Close() error { + return W.WClose() +} +func (W _net_Conn) LocalAddr() net.Addr { + return W.WLocalAddr() +} +func (W _net_Conn) Read(b []byte) (n int, err error) { + return W.WRead(b) +} +func (W _net_Conn) RemoteAddr() net.Addr { + return W.WRemoteAddr() +} +func (W _net_Conn) SetDeadline(t time.Time) error { + return W.WSetDeadline(t) +} +func (W _net_Conn) SetReadDeadline(t time.Time) error { + return W.WSetReadDeadline(t) +} +func (W _net_Conn) SetWriteDeadline(t time.Time) error { + return W.WSetWriteDeadline(t) +} +func (W _net_Conn) Write(b []byte) (n int, err error) { + return W.WWrite(b) +} // _net_Error is an interface wrapper for Error type type _net_Error struct { + IValue interface{} WError func() string WTemporary func() bool WTimeout func() bool } -func (W _net_Error) Error() string { return W.WError() } -func (W _net_Error) Temporary() bool { return W.WTemporary() } -func (W _net_Error) Timeout() bool { return W.WTimeout() } +func (W _net_Error) Error() string { + return W.WError() +} +func (W _net_Error) Temporary() bool { + return W.WTemporary() +} +func (W _net_Error) Timeout() bool { + return W.WTimeout() +} // _net_Listener is an interface wrapper for Listener type type _net_Listener struct { + IValue interface{} WAccept func() (net.Conn, error) WAddr func() net.Addr WClose func() error } -func (W _net_Listener) Accept() (net.Conn, error) { return W.WAccept() } -func (W _net_Listener) Addr() net.Addr { return W.WAddr() } -func (W _net_Listener) Close() error { return W.WClose() } +func (W _net_Listener) Accept() (net.Conn, error) { + return W.WAccept() +} +func (W _net_Listener) Addr() net.Addr { + return W.WAddr() +} +func (W _net_Listener) Close() error { + return W.WClose() +} // _net_PacketConn is an interface wrapper for PacketConn type type _net_PacketConn struct { + IValue interface{} WClose func() error WLocalAddr func() net.Addr WReadFrom func(p []byte) (n int, addr net.Addr, err error) @@ -187,12 +231,24 @@ type _net_PacketConn struct { WWriteTo func(p []byte, addr net.Addr) (n int, err error) } -func (W _net_PacketConn) Close() error { return W.WClose() } -func (W _net_PacketConn) LocalAddr() net.Addr { return W.WLocalAddr() } -func (W _net_PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { return W.WReadFrom(p) } -func (W _net_PacketConn) SetDeadline(t time.Time) error { return W.WSetDeadline(t) } -func (W _net_PacketConn) SetReadDeadline(t time.Time) error { return W.WSetReadDeadline(t) } -func (W _net_PacketConn) SetWriteDeadline(t time.Time) error { return W.WSetWriteDeadline(t) } +func (W _net_PacketConn) Close() error { + return W.WClose() +} +func (W _net_PacketConn) LocalAddr() net.Addr { + return W.WLocalAddr() +} +func (W _net_PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { + return W.WReadFrom(p) +} +func (W _net_PacketConn) SetDeadline(t time.Time) error { + return W.WSetDeadline(t) +} +func (W _net_PacketConn) SetReadDeadline(t time.Time) error { + return W.WSetReadDeadline(t) +} +func (W _net_PacketConn) SetWriteDeadline(t time.Time) error { + return W.WSetWriteDeadline(t) +} func (W _net_PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { return W.WWriteTo(p, addr) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http.go index 237fe44..eee808a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -16,8 +17,9 @@ import ( ) func init() { - Symbols["net/http"] = map[string]reflect.Value{ + Symbols["net/http/http"] = map[string]reflect.Value{ // function, constant and variable definitions + "AllowQuerySemicolons": reflect.ValueOf(http.AllowQuerySemicolons), "CanonicalHeaderKey": reflect.ValueOf(http.CanonicalHeaderKey), "DefaultClient": reflect.ValueOf(&http.DefaultClient).Elem(), "DefaultMaxHeaderBytes": reflect.ValueOf(constant.MakeFromLiteral("1048576", token.INT, 0)), @@ -56,6 +58,7 @@ func init() { "ListenAndServe": reflect.ValueOf(http.ListenAndServe), "ListenAndServeTLS": reflect.ValueOf(http.ListenAndServeTLS), "LocalAddrContextKey": reflect.ValueOf(&http.LocalAddrContextKey).Elem(), + "MaxBytesHandler": reflect.ValueOf(http.MaxBytesHandler), "MaxBytesReader": reflect.ValueOf(http.MaxBytesReader), "MethodConnect": reflect.ValueOf(constant.MakeFromLiteral("\"CONNECT\"", token.STRING, 0)), "MethodDelete": reflect.ValueOf(constant.MakeFromLiteral("\"DELETE\"", token.STRING, 0)), @@ -208,24 +211,31 @@ func init() { // _net_http_CloseNotifier is an interface wrapper for CloseNotifier type type _net_http_CloseNotifier struct { + IValue interface{} WCloseNotify func() <-chan bool } -func (W _net_http_CloseNotifier) CloseNotify() <-chan bool { return W.WCloseNotify() } +func (W _net_http_CloseNotifier) CloseNotify() <-chan bool { + return W.WCloseNotify() +} // _net_http_CookieJar is an interface wrapper for CookieJar type type _net_http_CookieJar struct { + IValue interface{} WCookies func(u *url.URL) []*http.Cookie WSetCookies func(u *url.URL, cookies []*http.Cookie) } -func (W _net_http_CookieJar) Cookies(u *url.URL) []*http.Cookie { return W.WCookies(u) } +func (W _net_http_CookieJar) Cookies(u *url.URL) []*http.Cookie { + return W.WCookies(u) +} func (W _net_http_CookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) { W.WSetCookies(u, cookies) } // _net_http_File is an interface wrapper for File type type _net_http_File struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WReaddir func(count int) ([]fs.FileInfo, error) @@ -233,43 +243,66 @@ type _net_http_File struct { WStat func() (fs.FileInfo, error) } -func (W _net_http_File) Close() error { return W.WClose() } -func (W _net_http_File) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _net_http_File) Readdir(count int) ([]fs.FileInfo, error) { return W.WReaddir(count) } -func (W _net_http_File) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _net_http_File) Stat() (fs.FileInfo, error) { return W.WStat() } +func (W _net_http_File) Close() error { + return W.WClose() +} +func (W _net_http_File) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _net_http_File) Readdir(count int) ([]fs.FileInfo, error) { + return W.WReaddir(count) +} +func (W _net_http_File) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} +func (W _net_http_File) Stat() (fs.FileInfo, error) { + return W.WStat() +} // _net_http_FileSystem is an interface wrapper for FileSystem type type _net_http_FileSystem struct { - WOpen func(name string) (http.File, error) + IValue interface{} + WOpen func(name string) (http.File, error) } -func (W _net_http_FileSystem) Open(name string) (http.File, error) { return W.WOpen(name) } +func (W _net_http_FileSystem) Open(name string) (http.File, error) { + return W.WOpen(name) +} // _net_http_Flusher is an interface wrapper for Flusher type type _net_http_Flusher struct { + IValue interface{} WFlush func() } -func (W _net_http_Flusher) Flush() { W.WFlush() } +func (W _net_http_Flusher) Flush() { + W.WFlush() +} // _net_http_Handler is an interface wrapper for Handler type type _net_http_Handler struct { + IValue interface{} WServeHTTP func(a0 http.ResponseWriter, a1 *http.Request) } -func (W _net_http_Handler) ServeHTTP(a0 http.ResponseWriter, a1 *http.Request) { W.WServeHTTP(a0, a1) } +func (W _net_http_Handler) ServeHTTP(a0 http.ResponseWriter, a1 *http.Request) { + W.WServeHTTP(a0, a1) +} // _net_http_Hijacker is an interface wrapper for Hijacker type type _net_http_Hijacker struct { + IValue interface{} WHijack func() (net.Conn, *bufio.ReadWriter, error) } -func (W _net_http_Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { return W.WHijack() } +func (W _net_http_Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return W.WHijack() +} // _net_http_Pusher is an interface wrapper for Pusher type type _net_http_Pusher struct { - WPush func(target string, opts *http.PushOptions) error + IValue interface{} + WPush func(target string, opts *http.PushOptions) error } func (W _net_http_Pusher) Push(target string, opts *http.PushOptions) error { @@ -278,17 +311,25 @@ func (W _net_http_Pusher) Push(target string, opts *http.PushOptions) error { // _net_http_ResponseWriter is an interface wrapper for ResponseWriter type type _net_http_ResponseWriter struct { + IValue interface{} WHeader func() http.Header WWrite func(a0 []byte) (int, error) WWriteHeader func(statusCode int) } -func (W _net_http_ResponseWriter) Header() http.Header { return W.WHeader() } -func (W _net_http_ResponseWriter) Write(a0 []byte) (int, error) { return W.WWrite(a0) } -func (W _net_http_ResponseWriter) WriteHeader(statusCode int) { W.WWriteHeader(statusCode) } +func (W _net_http_ResponseWriter) Header() http.Header { + return W.WHeader() +} +func (W _net_http_ResponseWriter) Write(a0 []byte) (int, error) { + return W.WWrite(a0) +} +func (W _net_http_ResponseWriter) WriteHeader(statusCode int) { + W.WWriteHeader(statusCode) +} // _net_http_RoundTripper is an interface wrapper for RoundTripper type type _net_http_RoundTripper struct { + IValue interface{} WRoundTrip func(a0 *http.Request) (*http.Response, error) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cgi.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cgi.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cgi.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cgi.go index 425b13a..87dbf7d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cgi.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cgi.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/cgi'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/cgi"] = map[string]reflect.Value{ + Symbols["net/http/cgi/cgi"] = map[string]reflect.Value{ // function, constant and variable definitions "Request": reflect.ValueOf(cgi.Request), "RequestFromMap": reflect.ValueOf(cgi.RequestFromMap), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cookiejar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cookiejar.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cookiejar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cookiejar.go index 10eb3b3..553c3ae 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cookiejar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_cookiejar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/cookiejar'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/cookiejar"] = map[string]reflect.Value{ + Symbols["net/http/cookiejar/cookiejar"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(cookiejar.New), @@ -26,6 +27,7 @@ func init() { // _net_http_cookiejar_PublicSuffixList is an interface wrapper for PublicSuffixList type type _net_http_cookiejar_PublicSuffixList struct { + IValue interface{} WPublicSuffix func(domain string) string WString func() string } @@ -33,4 +35,9 @@ type _net_http_cookiejar_PublicSuffixList struct { func (W _net_http_cookiejar_PublicSuffixList) PublicSuffix(domain string) string { return W.WPublicSuffix(domain) } -func (W _net_http_cookiejar_PublicSuffixList) String() string { return W.WString() } +func (W _net_http_cookiejar_PublicSuffixList) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_fcgi.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_fcgi.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_fcgi.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_fcgi.go index 36be1b2..c5670de 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_fcgi.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_fcgi.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/fcgi'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/fcgi"] = map[string]reflect.Value{ + Symbols["net/http/fcgi/fcgi"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrConnClosed": reflect.ValueOf(&fcgi.ErrConnClosed).Elem(), "ErrRequestAborted": reflect.ValueOf(&fcgi.ErrRequestAborted).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptest.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptest.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptest.go index 3900102..522854a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptest.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptest.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httptest'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["net/http/httptest"] = map[string]reflect.Value{ + Symbols["net/http/httptest/httptest"] = map[string]reflect.Value{ // function, constant and variable definitions "DefaultRemoteAddr": reflect.ValueOf(constant.MakeFromLiteral("\"1.2.3.4\"", token.STRING, 0)), "NewRecorder": reflect.ValueOf(httptest.NewRecorder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptrace.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptrace.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptrace.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptrace.go index 691d81b..464660c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httptrace.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httptrace.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httptrace'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/httptrace"] = map[string]reflect.Value{ + Symbols["net/http/httptrace/httptrace"] = map[string]reflect.Value{ // function, constant and variable definitions "ContextClientTrace": reflect.ValueOf(httptrace.ContextClientTrace), "WithClientTrace": reflect.ValueOf(httptrace.WithClientTrace), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httputil.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httputil.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httputil.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httputil.go index 80c6505..0a4bfac 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httputil.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_httputil.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httputil'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/httputil"] = map[string]reflect.Value{ + Symbols["net/http/httputil/httputil"] = map[string]reflect.Value{ // function, constant and variable definitions "DumpRequest": reflect.ValueOf(httputil.DumpRequest), "DumpRequestOut": reflect.ValueOf(httputil.DumpRequestOut), @@ -39,9 +40,14 @@ func init() { // _net_http_httputil_BufferPool is an interface wrapper for BufferPool type type _net_http_httputil_BufferPool struct { - WGet func() []byte - WPut func(a0 []byte) + IValue interface{} + WGet func() []byte + WPut func(a0 []byte) } -func (W _net_http_httputil_BufferPool) Get() []byte { return W.WGet() } -func (W _net_http_httputil_BufferPool) Put(a0 []byte) { W.WPut(a0) } +func (W _net_http_httputil_BufferPool) Get() []byte { + return W.WGet() +} +func (W _net_http_httputil_BufferPool) Put(a0 []byte) { + W.WPut(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_pprof.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_pprof.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_pprof.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_pprof.go index 8011f95..cf3b836 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_pprof.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_http_pprof.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/pprof'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/pprof"] = map[string]reflect.Value{ + Symbols["net/http/pprof/pprof"] = map[string]reflect.Value{ // function, constant and variable definitions "Cmdline": reflect.ValueOf(pprof.Cmdline), "Handler": reflect.ValueOf(pprof.Handler), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_mail.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_mail.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_mail.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_mail.go index 5ee0ab6..77ba53d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_mail.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_mail.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/mail'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/mail"] = map[string]reflect.Value{ + Symbols["net/mail/mail"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrHeaderNotPresent": reflect.ValueOf(&mail.ErrHeaderNotPresent).Elem(), "ParseAddress": reflect.ValueOf(mail.ParseAddress), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_netip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_netip.go new file mode 100644 index 0000000..7448f9b --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_netip.go @@ -0,0 +1,36 @@ +// Code generated by 'yaegi extract net/netip'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "net/netip" + "reflect" +) + +func init() { + Symbols["net/netip/netip"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AddrFrom16": reflect.ValueOf(netip.AddrFrom16), + "AddrFrom4": reflect.ValueOf(netip.AddrFrom4), + "AddrFromSlice": reflect.ValueOf(netip.AddrFromSlice), + "AddrPortFrom": reflect.ValueOf(netip.AddrPortFrom), + "IPv4Unspecified": reflect.ValueOf(netip.IPv4Unspecified), + "IPv6LinkLocalAllNodes": reflect.ValueOf(netip.IPv6LinkLocalAllNodes), + "IPv6Unspecified": reflect.ValueOf(netip.IPv6Unspecified), + "MustParseAddr": reflect.ValueOf(netip.MustParseAddr), + "MustParseAddrPort": reflect.ValueOf(netip.MustParseAddrPort), + "MustParsePrefix": reflect.ValueOf(netip.MustParsePrefix), + "ParseAddr": reflect.ValueOf(netip.ParseAddr), + "ParseAddrPort": reflect.ValueOf(netip.ParseAddrPort), + "ParsePrefix": reflect.ValueOf(netip.ParsePrefix), + "PrefixFrom": reflect.ValueOf(netip.PrefixFrom), + + // type definitions + "Addr": reflect.ValueOf((*netip.Addr)(nil)), + "AddrPort": reflect.ValueOf((*netip.AddrPort)(nil)), + "Prefix": reflect.ValueOf((*netip.Prefix)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc.go index 8c98b6f..4b26917 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/rpc'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["net/rpc"] = map[string]reflect.Value{ + Symbols["net/rpc/rpc"] = map[string]reflect.Value{ // function, constant and variable definitions "Accept": reflect.ValueOf(rpc.Accept), "DefaultDebugPath": reflect.ValueOf(constant.MakeFromLiteral("\"/debug/rpc\"", token.STRING, 0)), @@ -50,34 +51,44 @@ func init() { // _net_rpc_ClientCodec is an interface wrapper for ClientCodec type type _net_rpc_ClientCodec struct { + IValue interface{} WClose func() error - WReadResponseBody func(a0 interface{}) error + WReadResponseBody func(a0 any) error WReadResponseHeader func(a0 *rpc.Response) error - WWriteRequest func(a0 *rpc.Request, a1 interface{}) error + WWriteRequest func(a0 *rpc.Request, a1 any) error } -func (W _net_rpc_ClientCodec) Close() error { return W.WClose() } -func (W _net_rpc_ClientCodec) ReadResponseBody(a0 interface{}) error { return W.WReadResponseBody(a0) } +func (W _net_rpc_ClientCodec) Close() error { + return W.WClose() +} +func (W _net_rpc_ClientCodec) ReadResponseBody(a0 any) error { + return W.WReadResponseBody(a0) +} func (W _net_rpc_ClientCodec) ReadResponseHeader(a0 *rpc.Response) error { return W.WReadResponseHeader(a0) } -func (W _net_rpc_ClientCodec) WriteRequest(a0 *rpc.Request, a1 interface{}) error { +func (W _net_rpc_ClientCodec) WriteRequest(a0 *rpc.Request, a1 any) error { return W.WWriteRequest(a0, a1) } // _net_rpc_ServerCodec is an interface wrapper for ServerCodec type type _net_rpc_ServerCodec struct { + IValue interface{} WClose func() error - WReadRequestBody func(a0 interface{}) error + WReadRequestBody func(a0 any) error WReadRequestHeader func(a0 *rpc.Request) error - WWriteResponse func(a0 *rpc.Response, a1 interface{}) error + WWriteResponse func(a0 *rpc.Response, a1 any) error } -func (W _net_rpc_ServerCodec) Close() error { return W.WClose() } -func (W _net_rpc_ServerCodec) ReadRequestBody(a0 interface{}) error { return W.WReadRequestBody(a0) } +func (W _net_rpc_ServerCodec) Close() error { + return W.WClose() +} +func (W _net_rpc_ServerCodec) ReadRequestBody(a0 any) error { + return W.WReadRequestBody(a0) +} func (W _net_rpc_ServerCodec) ReadRequestHeader(a0 *rpc.Request) error { return W.WReadRequestHeader(a0) } -func (W _net_rpc_ServerCodec) WriteResponse(a0 *rpc.Response, a1 interface{}) error { +func (W _net_rpc_ServerCodec) WriteResponse(a0 *rpc.Response, a1 any) error { return W.WWriteResponse(a0, a1) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc_jsonrpc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc_jsonrpc.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc_jsonrpc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc_jsonrpc.go index d79b3c6..93cd11b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_rpc_jsonrpc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_rpc_jsonrpc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/rpc/jsonrpc'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/rpc/jsonrpc"] = map[string]reflect.Value{ + Symbols["net/rpc/jsonrpc/jsonrpc"] = map[string]reflect.Value{ // function, constant and variable definitions "Dial": reflect.ValueOf(jsonrpc.Dial), "NewClient": reflect.ValueOf(jsonrpc.NewClient), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_smtp.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_smtp.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_smtp.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_smtp.go index 6973ed0..19e2513 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_smtp.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_smtp.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/smtp'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/smtp"] = map[string]reflect.Value{ + Symbols["net/smtp/smtp"] = map[string]reflect.Value{ // function, constant and variable definitions "CRAMMD5Auth": reflect.ValueOf(smtp.CRAMMD5Auth), "Dial": reflect.ValueOf(smtp.Dial), @@ -30,6 +31,7 @@ func init() { // _net_smtp_Auth is an interface wrapper for Auth type type _net_smtp_Auth struct { + IValue interface{} WNext func(fromServer []byte, more bool) (toServer []byte, err error) WStart func(server *smtp.ServerInfo) (proto string, toServer []byte, err error) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_textproto.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_textproto.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_textproto.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_textproto.go index ccc3e52..e7b9478 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_textproto.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_textproto.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/textproto'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/textproto"] = map[string]reflect.Value{ + Symbols["net/textproto/textproto"] = map[string]reflect.Value{ // function, constant and variable definitions "CanonicalMIMEHeaderKey": reflect.ValueOf(textproto.CanonicalMIMEHeaderKey), "Dial": reflect.ValueOf(textproto.Dial), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_url.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_url.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_url.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_net_url.go index 638e3c6..b0ca231 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_url.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_net_url.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/url'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/url"] = map[string]reflect.Value{ + Symbols["net/url/url"] = map[string]reflect.Value{ // function, constant and variable definitions "Parse": reflect.ValueOf(url.Parse), "ParseQuery": reflect.ValueOf(url.ParseQuery), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_os.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_os.go index 1f5fe57..17db6cd 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os.go @@ -1,19 +1,21 @@ // Code generated by 'yaegi extract os'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib import ( "go/constant" "go/token" + "io/fs" "os" "reflect" "time" ) func init() { - Symbols["os"] = map[string]reflect.Value{ + Symbols["os/os"] = map[string]reflect.Value{ // function, constant and variable definitions "Args": reflect.ValueOf(&os.Args).Elem(), "Chdir": reflect.ValueOf(os.Chdir), @@ -22,7 +24,9 @@ func init() { "Chtimes": reflect.ValueOf(os.Chtimes), "Clearenv": reflect.ValueOf(os.Clearenv), "Create": reflect.ValueOf(os.Create), + "CreateTemp": reflect.ValueOf(os.CreateTemp), "DevNull": reflect.ValueOf(constant.MakeFromLiteral("\"/dev/null\"", token.STRING, 0)), + "DirFS": reflect.ValueOf(os.DirFS), "Environ": reflect.ValueOf(os.Environ), "ErrClosed": reflect.ValueOf(&os.ErrClosed).Elem(), "ErrDeadlineExceeded": reflect.ValueOf(&os.ErrDeadlineExceeded).Elem(), @@ -31,6 +35,7 @@ func init() { "ErrNoDeadline": reflect.ValueOf(&os.ErrNoDeadline).Elem(), "ErrNotExist": reflect.ValueOf(&os.ErrNotExist).Elem(), "ErrPermission": reflect.ValueOf(&os.ErrPermission).Elem(), + "ErrProcessDone": reflect.ValueOf(&os.ErrProcessDone).Elem(), "Executable": reflect.ValueOf(os.Executable), "Exit": reflect.ValueOf(osExit), "Expand": reflect.ValueOf(os.Expand), @@ -60,6 +65,7 @@ func init() { "Lstat": reflect.ValueOf(os.Lstat), "Mkdir": reflect.ValueOf(os.Mkdir), "MkdirAll": reflect.ValueOf(os.MkdirAll), + "MkdirTemp": reflect.ValueOf(os.MkdirTemp), "ModeAppend": reflect.ValueOf(os.ModeAppend), "ModeCharDevice": reflect.ValueOf(os.ModeCharDevice), "ModeDevice": reflect.ValueOf(os.ModeDevice), @@ -90,6 +96,8 @@ func init() { "PathListSeparator": reflect.ValueOf(constant.MakeFromLiteral("58", token.INT, 0)), "PathSeparator": reflect.ValueOf(constant.MakeFromLiteral("47", token.INT, 0)), "Pipe": reflect.ValueOf(os.Pipe), + "ReadDir": reflect.ValueOf(os.ReadDir), + "ReadFile": reflect.ValueOf(os.ReadFile), "Readlink": reflect.ValueOf(os.Readlink), "Remove": reflect.ValueOf(os.Remove), "RemoveAll": reflect.ValueOf(os.RemoveAll), @@ -111,8 +119,10 @@ func init() { "UserCacheDir": reflect.ValueOf(os.UserCacheDir), "UserConfigDir": reflect.ValueOf(os.UserConfigDir), "UserHomeDir": reflect.ValueOf(os.UserHomeDir), + "WriteFile": reflect.ValueOf(os.WriteFile), // type definitions + "DirEntry": reflect.ValueOf((*os.DirEntry)(nil)), "File": reflect.ValueOf((*os.File)(nil)), "FileInfo": reflect.ValueOf((*os.FileInfo)(nil)), "FileMode": reflect.ValueOf((*os.FileMode)(nil)), @@ -125,33 +135,77 @@ func init() { "SyscallError": reflect.ValueOf((*os.SyscallError)(nil)), // interface wrapper definitions + "_DirEntry": reflect.ValueOf((*_os_DirEntry)(nil)), "_FileInfo": reflect.ValueOf((*_os_FileInfo)(nil)), "_Signal": reflect.ValueOf((*_os_Signal)(nil)), } } +// _os_DirEntry is an interface wrapper for DirEntry type +type _os_DirEntry struct { + IValue interface{} + WInfo func() (fs.FileInfo, error) + WIsDir func() bool + WName func() string + WType func() fs.FileMode +} + +func (W _os_DirEntry) Info() (fs.FileInfo, error) { + return W.WInfo() +} +func (W _os_DirEntry) IsDir() bool { + return W.WIsDir() +} +func (W _os_DirEntry) Name() string { + return W.WName() +} +func (W _os_DirEntry) Type() fs.FileMode { + return W.WType() +} + // _os_FileInfo is an interface wrapper for FileInfo type type _os_FileInfo struct { + IValue interface{} WIsDir func() bool WModTime func() time.Time - WMode func() os.FileMode + WMode func() fs.FileMode WName func() string WSize func() int64 - WSys func() interface{} + WSys func() any } -func (W _os_FileInfo) IsDir() bool { return W.WIsDir() } -func (W _os_FileInfo) ModTime() time.Time { return W.WModTime() } -func (W _os_FileInfo) Mode() os.FileMode { return W.WMode() } -func (W _os_FileInfo) Name() string { return W.WName() } -func (W _os_FileInfo) Size() int64 { return W.WSize() } -func (W _os_FileInfo) Sys() interface{} { return W.WSys() } +func (W _os_FileInfo) IsDir() bool { + return W.WIsDir() +} +func (W _os_FileInfo) ModTime() time.Time { + return W.WModTime() +} +func (W _os_FileInfo) Mode() fs.FileMode { + return W.WMode() +} +func (W _os_FileInfo) Name() string { + return W.WName() +} +func (W _os_FileInfo) Size() int64 { + return W.WSize() +} +func (W _os_FileInfo) Sys() any { + return W.WSys() +} // _os_Signal is an interface wrapper for Signal type type _os_Signal struct { + IValue interface{} WSignal func() WString func() string } -func (W _os_Signal) Signal() { W.WSignal() } -func (W _os_Signal) String() string { return W.WString() } +func (W _os_Signal) Signal() { + W.WSignal() +} +func (W _os_Signal) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_os_signal.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os_signal.go new file mode 100644 index 0000000..5da2318 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os_signal.go @@ -0,0 +1,23 @@ +// Code generated by 'yaegi extract os/signal'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "os/signal" + "reflect" +) + +func init() { + Symbols["os/signal/signal"] = map[string]reflect.Value{ + // function, constant and variable definitions + "Ignore": reflect.ValueOf(signal.Ignore), + "Ignored": reflect.ValueOf(signal.Ignored), + "Notify": reflect.ValueOf(signal.Notify), + "NotifyContext": reflect.ValueOf(signal.NotifyContext), + "Reset": reflect.ValueOf(signal.Reset), + "Stop": reflect.ValueOf(signal.Stop), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os_user.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os_user.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_os_user.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_os_user.go index 5009517..751d8bf 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os_user.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_os_user.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract os/user'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["os/user"] = map[string]reflect.Value{ + Symbols["os/user/user"] = map[string]reflect.Value{ // function, constant and variable definitions "Current": reflect.ValueOf(user.Current), "Lookup": reflect.ValueOf(user.Lookup), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_path.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_path.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_path.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_path.go index 088b93d..cb9aa8a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_path.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_path.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract path'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["path"] = map[string]reflect.Value{ + Symbols["path/path"] = map[string]reflect.Value{ // function, constant and variable definitions "Base": reflect.ValueOf(path.Base), "Clean": reflect.ValueOf(path.Clean), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_path_filepath.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_path_filepath.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_path_filepath.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_path_filepath.go index 1b01595..c2cda82 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_path_filepath.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_path_filepath.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract path/filepath'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["path/filepath"] = map[string]reflect.Value{ + Symbols["path/filepath/filepath"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(filepath.Abs), "Base": reflect.ValueOf(filepath.Base), @@ -36,6 +37,7 @@ func init() { "ToSlash": reflect.ValueOf(filepath.ToSlash), "VolumeName": reflect.ValueOf(filepath.VolumeName), "Walk": reflect.ValueOf(filepath.Walk), + "WalkDir": reflect.ValueOf(filepath.WalkDir), // type definitions "WalkFunc": reflect.ValueOf((*filepath.WalkFunc)(nil)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_reflect.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_reflect.go similarity index 70% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_reflect.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_reflect.go index 827d0c1..6b86fe5 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_reflect.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_reflect.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract reflect'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -9,7 +10,7 @@ import ( ) func init() { - Symbols["reflect"] = map[string]reflect.Value{ + Symbols["reflect/reflect"] = map[string]reflect.Value{ // function, constant and variable definitions "Append": reflect.ValueOf(reflect.Append), "AppendSlice": reflect.ValueOf(reflect.AppendSlice), @@ -44,6 +45,8 @@ func init() { "MapOf": reflect.ValueOf(reflect.MapOf), "New": reflect.ValueOf(reflect.New), "NewAt": reflect.ValueOf(reflect.NewAt), + "Pointer": reflect.ValueOf(reflect.Pointer), + "PointerTo": reflect.ValueOf(reflect.PointerTo), "Ptr": reflect.ValueOf(reflect.Ptr), "PtrTo": reflect.ValueOf(reflect.PtrTo), "RecvDir": reflect.ValueOf(reflect.RecvDir), @@ -67,6 +70,7 @@ func init() { "Uintptr": reflect.ValueOf(reflect.Uintptr), "UnsafePointer": reflect.ValueOf(reflect.UnsafePointer), "ValueOf": reflect.ValueOf(reflect.ValueOf), + "VisibleFields": reflect.ValueOf(reflect.VisibleFields), "Zero": reflect.ValueOf(reflect.Zero), // type definitions @@ -91,6 +95,7 @@ func init() { // _reflect_Type is an interface wrapper for Type type type _reflect_Type struct { + IValue interface{} WAlign func() int WAssignableTo func(u reflect.Type) bool WBits func() int @@ -122,36 +127,93 @@ type _reflect_Type struct { WString func() string } -func (W _reflect_Type) Align() int { return W.WAlign() } -func (W _reflect_Type) AssignableTo(u reflect.Type) bool { return W.WAssignableTo(u) } -func (W _reflect_Type) Bits() int { return W.WBits() } -func (W _reflect_Type) ChanDir() reflect.ChanDir { return W.WChanDir() } -func (W _reflect_Type) Comparable() bool { return W.WComparable() } -func (W _reflect_Type) ConvertibleTo(u reflect.Type) bool { return W.WConvertibleTo(u) } -func (W _reflect_Type) Elem() reflect.Type { return W.WElem() } -func (W _reflect_Type) Field(i int) reflect.StructField { return W.WField(i) } -func (W _reflect_Type) FieldAlign() int { return W.WFieldAlign() } -func (W _reflect_Type) FieldByIndex(index []int) reflect.StructField { return W.WFieldByIndex(index) } +func (W _reflect_Type) Align() int { + return W.WAlign() +} +func (W _reflect_Type) AssignableTo(u reflect.Type) bool { + return W.WAssignableTo(u) +} +func (W _reflect_Type) Bits() int { + return W.WBits() +} +func (W _reflect_Type) ChanDir() reflect.ChanDir { + return W.WChanDir() +} +func (W _reflect_Type) Comparable() bool { + return W.WComparable() +} +func (W _reflect_Type) ConvertibleTo(u reflect.Type) bool { + return W.WConvertibleTo(u) +} +func (W _reflect_Type) Elem() reflect.Type { + return W.WElem() +} +func (W _reflect_Type) Field(i int) reflect.StructField { + return W.WField(i) +} +func (W _reflect_Type) FieldAlign() int { + return W.WFieldAlign() +} +func (W _reflect_Type) FieldByIndex(index []int) reflect.StructField { + return W.WFieldByIndex(index) +} func (W _reflect_Type) FieldByName(name string) (reflect.StructField, bool) { return W.WFieldByName(name) } func (W _reflect_Type) FieldByNameFunc(match func(string) bool) (reflect.StructField, bool) { return W.WFieldByNameFunc(match) } -func (W _reflect_Type) Implements(u reflect.Type) bool { return W.WImplements(u) } -func (W _reflect_Type) In(i int) reflect.Type { return W.WIn(i) } -func (W _reflect_Type) IsVariadic() bool { return W.WIsVariadic() } -func (W _reflect_Type) Key() reflect.Type { return W.WKey() } -func (W _reflect_Type) Kind() reflect.Kind { return W.WKind() } -func (W _reflect_Type) Len() int { return W.WLen() } -func (W _reflect_Type) Method(a0 int) reflect.Method { return W.WMethod(a0) } -func (W _reflect_Type) MethodByName(a0 string) (reflect.Method, bool) { return W.WMethodByName(a0) } -func (W _reflect_Type) Name() string { return W.WName() } -func (W _reflect_Type) NumField() int { return W.WNumField() } -func (W _reflect_Type) NumIn() int { return W.WNumIn() } -func (W _reflect_Type) NumMethod() int { return W.WNumMethod() } -func (W _reflect_Type) NumOut() int { return W.WNumOut() } -func (W _reflect_Type) Out(i int) reflect.Type { return W.WOut(i) } -func (W _reflect_Type) PkgPath() string { return W.WPkgPath() } -func (W _reflect_Type) Size() uintptr { return W.WSize() } -func (W _reflect_Type) String() string { return W.WString() } +func (W _reflect_Type) Implements(u reflect.Type) bool { + return W.WImplements(u) +} +func (W _reflect_Type) In(i int) reflect.Type { + return W.WIn(i) +} +func (W _reflect_Type) IsVariadic() bool { + return W.WIsVariadic() +} +func (W _reflect_Type) Key() reflect.Type { + return W.WKey() +} +func (W _reflect_Type) Kind() reflect.Kind { + return W.WKind() +} +func (W _reflect_Type) Len() int { + return W.WLen() +} +func (W _reflect_Type) Method(a0 int) reflect.Method { + return W.WMethod(a0) +} +func (W _reflect_Type) MethodByName(a0 string) (reflect.Method, bool) { + return W.WMethodByName(a0) +} +func (W _reflect_Type) Name() string { + return W.WName() +} +func (W _reflect_Type) NumField() int { + return W.WNumField() +} +func (W _reflect_Type) NumIn() int { + return W.WNumIn() +} +func (W _reflect_Type) NumMethod() int { + return W.WNumMethod() +} +func (W _reflect_Type) NumOut() int { + return W.WNumOut() +} +func (W _reflect_Type) Out(i int) reflect.Type { + return W.WOut(i) +} +func (W _reflect_Type) PkgPath() string { + return W.WPkgPath() +} +func (W _reflect_Type) Size() uintptr { + return W.WSize() +} +func (W _reflect_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp.go index af97f28..4bed631 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract regexp'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["regexp"] = map[string]reflect.Value{ + Symbols["regexp/regexp"] = map[string]reflect.Value{ // function, constant and variable definitions "Compile": reflect.ValueOf(regexp.Compile), "CompilePOSIX": reflect.ValueOf(regexp.CompilePOSIX), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp_syntax.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp_syntax.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp_syntax.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp_syntax.go index ff41131..1c3a3cb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_regexp_syntax.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_regexp_syntax.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract regexp/syntax'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["regexp/syntax"] = map[string]reflect.Value{ + Symbols["regexp/syntax/syntax"] = map[string]reflect.Value{ // function, constant and variable definitions "ClassNL": reflect.ValueOf(syntax.ClassNL), "Compile": reflect.ValueOf(syntax.Compile), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime.go index 50cc147..41b04ae 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["runtime"] = map[string]reflect.Value{ + Symbols["runtime/runtime"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockProfile": reflect.ValueOf(runtime.BlockProfile), "Breakpoint": reflect.ValueOf(runtime.Breakpoint), @@ -70,9 +71,14 @@ func init() { // _runtime_Error is an interface wrapper for Error type type _runtime_Error struct { + IValue interface{} WError func() string WRuntimeError func() } -func (W _runtime_Error) Error() string { return W.WError() } -func (W _runtime_Error) RuntimeError() { W.WRuntimeError() } +func (W _runtime_Error) Error() string { + return W.WError() +} +func (W _runtime_Error) RuntimeError() { + W.WRuntimeError() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_debug.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_debug.go similarity index 67% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_debug.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_debug.go index 1d34cab..61c9c3b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_debug.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_debug.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/debug'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,9 +11,10 @@ import ( ) func init() { - Symbols["runtime/debug"] = map[string]reflect.Value{ + Symbols["runtime/debug/debug"] = map[string]reflect.Value{ // function, constant and variable definitions "FreeOSMemory": reflect.ValueOf(debug.FreeOSMemory), + "ParseBuildInfo": reflect.ValueOf(debug.ParseBuildInfo), "PrintStack": reflect.ValueOf(debug.PrintStack), "ReadBuildInfo": reflect.ValueOf(debug.ReadBuildInfo), "ReadGCStats": reflect.ValueOf(debug.ReadGCStats), @@ -25,8 +27,9 @@ func init() { "WriteHeapDump": reflect.ValueOf(debug.WriteHeapDump), // type definitions - "BuildInfo": reflect.ValueOf((*debug.BuildInfo)(nil)), - "GCStats": reflect.ValueOf((*debug.GCStats)(nil)), - "Module": reflect.ValueOf((*debug.Module)(nil)), + "BuildInfo": reflect.ValueOf((*debug.BuildInfo)(nil)), + "BuildSetting": reflect.ValueOf((*debug.BuildSetting)(nil)), + "GCStats": reflect.ValueOf((*debug.GCStats)(nil)), + "Module": reflect.ValueOf((*debug.Module)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_metrics.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_metrics.go new file mode 100644 index 0000000..a51cab3 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_metrics.go @@ -0,0 +1,30 @@ +// Code generated by 'yaegi extract runtime/metrics'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "reflect" + "runtime/metrics" +) + +func init() { + Symbols["runtime/metrics/metrics"] = map[string]reflect.Value{ + // function, constant and variable definitions + "All": reflect.ValueOf(metrics.All), + "KindBad": reflect.ValueOf(metrics.KindBad), + "KindFloat64": reflect.ValueOf(metrics.KindFloat64), + "KindFloat64Histogram": reflect.ValueOf(metrics.KindFloat64Histogram), + "KindUint64": reflect.ValueOf(metrics.KindUint64), + "Read": reflect.ValueOf(metrics.Read), + + // type definitions + "Description": reflect.ValueOf((*metrics.Description)(nil)), + "Float64Histogram": reflect.ValueOf((*metrics.Float64Histogram)(nil)), + "Sample": reflect.ValueOf((*metrics.Sample)(nil)), + "Value": reflect.ValueOf((*metrics.Value)(nil)), + "ValueKind": reflect.ValueOf((*metrics.ValueKind)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_pprof.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_pprof.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_pprof.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_pprof.go index 756d690..f214f6e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_pprof.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_pprof.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/pprof'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["runtime/pprof"] = map[string]reflect.Value{ + Symbols["runtime/pprof/pprof"] = map[string]reflect.Value{ // function, constant and variable definitions "Do": reflect.ValueOf(pprof.Do), "ForLabels": reflect.ValueOf(pprof.ForLabels), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_trace.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_trace.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_trace.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_trace.go index d78a25a..812fcef 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime_trace.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_runtime_trace.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/trace'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["runtime/trace"] = map[string]reflect.Value{ + Symbols["runtime/trace/trace"] = map[string]reflect.Value{ // function, constant and variable definitions "IsEnabled": reflect.ValueOf(trace.IsEnabled), "Log": reflect.ValueOf(trace.Log), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sort.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sort.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_sort.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_sort.go index 0d5fb82..97d257c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sort.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sort.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sort'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["sort"] = map[string]reflect.Value{ + Symbols["sort/sort"] = map[string]reflect.Value{ // function, constant and variable definitions "Float64s": reflect.ValueOf(sort.Float64s), "Float64sAreSorted": reflect.ValueOf(sort.Float64sAreSorted), @@ -43,11 +44,18 @@ func init() { // _sort_Interface is an interface wrapper for Interface type type _sort_Interface struct { - WLen func() int - WLess func(i int, j int) bool - WSwap func(i int, j int) + IValue interface{} + WLen func() int + WLess func(i int, j int) bool + WSwap func(i int, j int) } -func (W _sort_Interface) Len() int { return W.WLen() } -func (W _sort_Interface) Less(i int, j int) bool { return W.WLess(i, j) } -func (W _sort_Interface) Swap(i int, j int) { W.WSwap(i, j) } +func (W _sort_Interface) Len() int { + return W.WLen() +} +func (W _sort_Interface) Less(i int, j int) bool { + return W.WLess(i, j) +} +func (W _sort_Interface) Swap(i int, j int) { + W.WSwap(i, j) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_strconv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_strconv.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_strconv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_strconv.go index 8fee295..94aa21d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_strconv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_strconv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract strconv'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["strconv"] = map[string]reflect.Value{ + Symbols["strconv/strconv"] = map[string]reflect.Value{ // function, constant and variable definitions "AppendBool": reflect.ValueOf(strconv.AppendBool), "AppendFloat": reflect.ValueOf(strconv.AppendFloat), @@ -48,6 +49,7 @@ func init() { "QuoteRuneToGraphic": reflect.ValueOf(strconv.QuoteRuneToGraphic), "QuoteToASCII": reflect.ValueOf(strconv.QuoteToASCII), "QuoteToGraphic": reflect.ValueOf(strconv.QuoteToGraphic), + "QuotedPrefix": reflect.ValueOf(strconv.QuotedPrefix), "Unquote": reflect.ValueOf(strconv.Unquote), "UnquoteChar": reflect.ValueOf(strconv.UnquoteChar), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_strings.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_strings.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_strings.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_strings.go index f155416..05b8f3c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_strings.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_strings.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract strings'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,13 +11,15 @@ import ( ) func init() { - Symbols["strings"] = map[string]reflect.Value{ + Symbols["strings/strings"] = map[string]reflect.Value{ // function, constant and variable definitions + "Clone": reflect.ValueOf(strings.Clone), "Compare": reflect.ValueOf(strings.Compare), "Contains": reflect.ValueOf(strings.Contains), "ContainsAny": reflect.ValueOf(strings.ContainsAny), "ContainsRune": reflect.ValueOf(strings.ContainsRune), "Count": reflect.ValueOf(strings.Count), + "Cut": reflect.ValueOf(strings.Cut), "EqualFold": reflect.ValueOf(strings.EqualFold), "Fields": reflect.ValueOf(strings.Fields), "FieldsFunc": reflect.ValueOf(strings.FieldsFunc), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sync.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sync.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_sync.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_sync.go index ff0c11b..589d3b9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sync.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sync.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sync'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["sync"] = map[string]reflect.Value{ + Symbols["sync/sync"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCond": reflect.ValueOf(sync.NewCond), @@ -31,9 +32,14 @@ func init() { // _sync_Locker is an interface wrapper for Locker type type _sync_Locker struct { + IValue interface{} WLock func() WUnlock func() } -func (W _sync_Locker) Lock() { W.WLock() } -func (W _sync_Locker) Unlock() { W.WUnlock() } +func (W _sync_Locker) Lock() { + W.WLock() +} +func (W _sync_Locker) Unlock() { + W.WUnlock() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sync_atomic.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sync_atomic.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_sync_atomic.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_sync_atomic.go index 1fa6d4e..43931e5 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sync_atomic.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_sync_atomic.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sync/atomic'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["sync/atomic"] = map[string]reflect.Value{ + Symbols["sync/atomic/atomic"] = map[string]reflect.Value{ // function, constant and variable definitions "AddInt32": reflect.ValueOf(atomic.AddInt32), "AddInt64": reflect.ValueOf(atomic.AddInt64), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing.go new file mode 100644 index 0000000..7d10714 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing.go @@ -0,0 +1,126 @@ +// Code generated by 'yaegi extract testing'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "reflect" + "testing" +) + +func init() { + Symbols["testing/testing"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AllocsPerRun": reflect.ValueOf(testing.AllocsPerRun), + "Benchmark": reflect.ValueOf(testing.Benchmark), + "CoverMode": reflect.ValueOf(testing.CoverMode), + "Coverage": reflect.ValueOf(testing.Coverage), + "Init": reflect.ValueOf(testing.Init), + "Main": reflect.ValueOf(testing.Main), + "MainStart": reflect.ValueOf(testing.MainStart), + "RegisterCover": reflect.ValueOf(testing.RegisterCover), + "RunBenchmarks": reflect.ValueOf(testing.RunBenchmarks), + "RunExamples": reflect.ValueOf(testing.RunExamples), + "RunTests": reflect.ValueOf(testing.RunTests), + "Short": reflect.ValueOf(testing.Short), + "Verbose": reflect.ValueOf(testing.Verbose), + + // type definitions + "B": reflect.ValueOf((*testing.B)(nil)), + "BenchmarkResult": reflect.ValueOf((*testing.BenchmarkResult)(nil)), + "Cover": reflect.ValueOf((*testing.Cover)(nil)), + "CoverBlock": reflect.ValueOf((*testing.CoverBlock)(nil)), + "F": reflect.ValueOf((*testing.F)(nil)), + "InternalBenchmark": reflect.ValueOf((*testing.InternalBenchmark)(nil)), + "InternalExample": reflect.ValueOf((*testing.InternalExample)(nil)), + "InternalFuzzTarget": reflect.ValueOf((*testing.InternalFuzzTarget)(nil)), + "InternalTest": reflect.ValueOf((*testing.InternalTest)(nil)), + "M": reflect.ValueOf((*testing.M)(nil)), + "PB": reflect.ValueOf((*testing.PB)(nil)), + "T": reflect.ValueOf((*testing.T)(nil)), + "TB": reflect.ValueOf((*testing.TB)(nil)), + + // interface wrapper definitions + "_TB": reflect.ValueOf((*_testing_TB)(nil)), + } +} + +// _testing_TB is an interface wrapper for TB type +type _testing_TB struct { + IValue interface{} + WCleanup func(a0 func()) + WError func(args ...any) + WErrorf func(format string, args ...any) + WFail func() + WFailNow func() + WFailed func() bool + WFatal func(args ...any) + WFatalf func(format string, args ...any) + WHelper func() + WLog func(args ...any) + WLogf func(format string, args ...any) + WName func() string + WSetenv func(key string, value string) + WSkip func(args ...any) + WSkipNow func() + WSkipf func(format string, args ...any) + WSkipped func() bool + WTempDir func() string +} + +func (W _testing_TB) Cleanup(a0 func()) { + W.WCleanup(a0) +} +func (W _testing_TB) Error(args ...any) { + W.WError(args...) +} +func (W _testing_TB) Errorf(format string, args ...any) { + W.WErrorf(format, args...) +} +func (W _testing_TB) Fail() { + W.WFail() +} +func (W _testing_TB) FailNow() { + W.WFailNow() +} +func (W _testing_TB) Failed() bool { + return W.WFailed() +} +func (W _testing_TB) Fatal(args ...any) { + W.WFatal(args...) +} +func (W _testing_TB) Fatalf(format string, args ...any) { + W.WFatalf(format, args...) +} +func (W _testing_TB) Helper() { + W.WHelper() +} +func (W _testing_TB) Log(args ...any) { + W.WLog(args...) +} +func (W _testing_TB) Logf(format string, args ...any) { + W.WLogf(format, args...) +} +func (W _testing_TB) Name() string { + return W.WName() +} +func (W _testing_TB) Setenv(key string, value string) { + W.WSetenv(key, value) +} +func (W _testing_TB) Skip(args ...any) { + W.WSkip(args...) +} +func (W _testing_TB) SkipNow() { + W.WSkipNow() +} +func (W _testing_TB) Skipf(format string, args ...any) { + W.WSkipf(format, args...) +} +func (W _testing_TB) Skipped() bool { + return W.WSkipped() +} +func (W _testing_TB) TempDir() string { + return W.WTempDir() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_fstest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_fstest.go new file mode 100644 index 0000000..6733a27 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_fstest.go @@ -0,0 +1,22 @@ +// Code generated by 'yaegi extract testing/fstest'. DO NOT EDIT. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package stdlib + +import ( + "reflect" + "testing/fstest" +) + +func init() { + Symbols["testing/fstest/fstest"] = map[string]reflect.Value{ + // function, constant and variable definitions + "TestFS": reflect.ValueOf(fstest.TestFS), + + // type definitions + "MapFS": reflect.ValueOf((*fstest.MapFS)(nil)), + "MapFile": reflect.ValueOf((*fstest.MapFile)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_iotest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_iotest.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_iotest.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_iotest.go index 9d2b081..e8be5e2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_iotest.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_iotest.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract testing/iotest'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,14 +11,16 @@ import ( ) func init() { - Symbols["testing/iotest"] = map[string]reflect.Value{ + Symbols["testing/iotest/iotest"] = map[string]reflect.Value{ // function, constant and variable definitions "DataErrReader": reflect.ValueOf(iotest.DataErrReader), + "ErrReader": reflect.ValueOf(iotest.ErrReader), "ErrTimeout": reflect.ValueOf(&iotest.ErrTimeout).Elem(), "HalfReader": reflect.ValueOf(iotest.HalfReader), "NewReadLogger": reflect.ValueOf(iotest.NewReadLogger), "NewWriteLogger": reflect.ValueOf(iotest.NewWriteLogger), "OneByteReader": reflect.ValueOf(iotest.OneByteReader), + "TestReader": reflect.ValueOf(iotest.TestReader), "TimeoutReader": reflect.ValueOf(iotest.TimeoutReader), "TruncateWriter": reflect.ValueOf(iotest.TruncateWriter), } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_quick.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_quick.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_quick.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_quick.go index 34be869..f3bdc86 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_quick.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_testing_quick.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract testing/quick'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["testing/quick"] = map[string]reflect.Value{ + Symbols["testing/quick/quick"] = map[string]reflect.Value{ // function, constant and variable definitions "Check": reflect.ValueOf(quick.Check), "CheckEqual": reflect.ValueOf(quick.CheckEqual), @@ -31,6 +32,7 @@ func init() { // _testing_quick_Generator is an interface wrapper for Generator type type _testing_quick_Generator struct { + IValue interface{} WGenerate func(rand *rand.Rand, size int) reflect.Value } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_scanner.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_scanner.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_text_scanner.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_text_scanner.go index 8ce7ddf..166f63f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_scanner.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_scanner.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/scanner'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["text/scanner"] = map[string]reflect.Value{ + Symbols["text/scanner/scanner"] = map[string]reflect.Value{ // function, constant and variable definitions "Char": reflect.ValueOf(constant.MakeFromLiteral("-5", token.INT, 0)), "Comment": reflect.ValueOf(constant.MakeFromLiteral("-8", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_tabwriter.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_tabwriter.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_text_tabwriter.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_text_tabwriter.go index c86930e..fcd4012 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_tabwriter.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_tabwriter.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/tabwriter'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["text/tabwriter"] = map[string]reflect.Value{ + Symbols["text/tabwriter/tabwriter"] = map[string]reflect.Value{ // function, constant and variable definitions "AlignRight": reflect.ValueOf(tabwriter.AlignRight), "Debug": reflect.ValueOf(tabwriter.Debug), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template.go index 10c51fa..d4fbf11 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/template'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["text/template"] = map[string]reflect.Value{ + Symbols["text/template/template"] = map[string]reflect.Value{ // function, constant and variable definitions "HTMLEscape": reflect.ValueOf(template.HTMLEscape), "HTMLEscapeString": reflect.ValueOf(template.HTMLEscapeString), @@ -21,6 +22,7 @@ func init() { "JSEscaper": reflect.ValueOf(template.JSEscaper), "Must": reflect.ValueOf(template.Must), "New": reflect.ValueOf(template.New), + "ParseFS": reflect.ValueOf(template.ParseFS), "ParseFiles": reflect.ValueOf(template.ParseFiles), "ParseGlob": reflect.ValueOf(template.ParseGlob), "URLQueryEscaper": reflect.ValueOf(template.URLQueryEscaper), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template_parse.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template_parse.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template_parse.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template_parse.go index 6522c80..6bb71d7 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_template_parse.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_text_template_parse.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/template/parse'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,15 +11,18 @@ import ( ) func init() { - Symbols["text/template/parse"] = map[string]reflect.Value{ + Symbols["text/template/parse/parse"] = map[string]reflect.Value{ // function, constant and variable definitions "IsEmptyTree": reflect.ValueOf(parse.IsEmptyTree), "New": reflect.ValueOf(parse.New), "NewIdentifier": reflect.ValueOf(parse.NewIdentifier), "NodeAction": reflect.ValueOf(parse.NodeAction), "NodeBool": reflect.ValueOf(parse.NodeBool), + "NodeBreak": reflect.ValueOf(parse.NodeBreak), "NodeChain": reflect.ValueOf(parse.NodeChain), "NodeCommand": reflect.ValueOf(parse.NodeCommand), + "NodeComment": reflect.ValueOf(parse.NodeComment), + "NodeContinue": reflect.ValueOf(parse.NodeContinue), "NodeDot": reflect.ValueOf(parse.NodeDot), "NodeField": reflect.ValueOf(parse.NodeField), "NodeIdentifier": reflect.ValueOf(parse.NodeIdentifier), @@ -34,18 +38,24 @@ func init() { "NodeVariable": reflect.ValueOf(parse.NodeVariable), "NodeWith": reflect.ValueOf(parse.NodeWith), "Parse": reflect.ValueOf(parse.Parse), + "ParseComments": reflect.ValueOf(parse.ParseComments), + "SkipFuncCheck": reflect.ValueOf(parse.SkipFuncCheck), // type definitions "ActionNode": reflect.ValueOf((*parse.ActionNode)(nil)), "BoolNode": reflect.ValueOf((*parse.BoolNode)(nil)), "BranchNode": reflect.ValueOf((*parse.BranchNode)(nil)), + "BreakNode": reflect.ValueOf((*parse.BreakNode)(nil)), "ChainNode": reflect.ValueOf((*parse.ChainNode)(nil)), "CommandNode": reflect.ValueOf((*parse.CommandNode)(nil)), + "CommentNode": reflect.ValueOf((*parse.CommentNode)(nil)), + "ContinueNode": reflect.ValueOf((*parse.ContinueNode)(nil)), "DotNode": reflect.ValueOf((*parse.DotNode)(nil)), "FieldNode": reflect.ValueOf((*parse.FieldNode)(nil)), "IdentifierNode": reflect.ValueOf((*parse.IdentifierNode)(nil)), "IfNode": reflect.ValueOf((*parse.IfNode)(nil)), "ListNode": reflect.ValueOf((*parse.ListNode)(nil)), + "Mode": reflect.ValueOf((*parse.Mode)(nil)), "NilNode": reflect.ValueOf((*parse.NilNode)(nil)), "Node": reflect.ValueOf((*parse.Node)(nil)), "NodeType": reflect.ValueOf((*parse.NodeType)(nil)), @@ -67,13 +77,25 @@ func init() { // _text_template_parse_Node is an interface wrapper for Node type type _text_template_parse_Node struct { + IValue interface{} WCopy func() parse.Node WPosition func() parse.Pos WString func() string WType func() parse.NodeType } -func (W _text_template_parse_Node) Copy() parse.Node { return W.WCopy() } -func (W _text_template_parse_Node) Position() parse.Pos { return W.WPosition() } -func (W _text_template_parse_Node) String() string { return W.WString() } -func (W _text_template_parse_Node) Type() parse.NodeType { return W.WType() } +func (W _text_template_parse_Node) Copy() parse.Node { + return W.WCopy() +} +func (W _text_template_parse_Node) Position() parse.Pos { + return W.WPosition() +} +func (W _text_template_parse_Node) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _text_template_parse_Node) Type() parse.NodeType { + return W.WType() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_time.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_time.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_time.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_time.go index eed219d..5b1cfc2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_time.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_time.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract time'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["time"] = map[string]reflect.Value{ + Symbols["time/time"] = map[string]reflect.Value{ // function, constant and variable definitions "ANSIC": reflect.ValueOf(constant.MakeFromLiteral("\"Mon Jan _2 15:04:05 2006\"", token.STRING, 0)), "After": reflect.ValueOf(time.After), @@ -29,6 +30,7 @@ func init() { "July": reflect.ValueOf(time.July), "June": reflect.ValueOf(time.June), "Kitchen": reflect.ValueOf(constant.MakeFromLiteral("\"3:04PM\"", token.STRING, 0)), + "Layout": reflect.ValueOf(constant.MakeFromLiteral("\"01/02 03:04:05PM '06 -0700\"", token.STRING, 0)), "LoadLocation": reflect.ValueOf(time.LoadLocation), "LoadLocationFromTZData": reflect.ValueOf(time.LoadLocationFromTZData), "Local": reflect.ValueOf(&time.Local).Elem(), @@ -71,6 +73,8 @@ func init() { "UTC": reflect.ValueOf(&time.UTC).Elem(), "Unix": reflect.ValueOf(time.Unix), "UnixDate": reflect.ValueOf(constant.MakeFromLiteral("\"Mon Jan _2 15:04:05 MST 2006\"", token.STRING, 0)), + "UnixMicro": reflect.ValueOf(time.UnixMicro), + "UnixMilli": reflect.ValueOf(time.UnixMilli), "Until": reflect.ValueOf(time.Until), "Wednesday": reflect.ValueOf(time.Wednesday), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode.go index 5f433ad..ca5d2ae 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["unicode"] = map[string]reflect.Value{ + Symbols["unicode/unicode"] = map[string]reflect.Value{ // function, constant and variable definitions "ASCII_Hex_Digit": reflect.ValueOf(&unicode.ASCII_Hex_Digit).Elem(), "Adlam": reflect.ValueOf(&unicode.Adlam).Elem(), @@ -45,6 +46,7 @@ func init() { "Chakma": reflect.ValueOf(&unicode.Chakma).Elem(), "Cham": reflect.ValueOf(&unicode.Cham).Elem(), "Cherokee": reflect.ValueOf(&unicode.Cherokee).Elem(), + "Chorasmian": reflect.ValueOf(&unicode.Chorasmian).Elem(), "Co": reflect.ValueOf(&unicode.Co).Elem(), "Common": reflect.ValueOf(&unicode.Common).Elem(), "Coptic": reflect.ValueOf(&unicode.Coptic).Elem(), @@ -58,6 +60,7 @@ func init() { "Devanagari": reflect.ValueOf(&unicode.Devanagari).Elem(), "Diacritic": reflect.ValueOf(&unicode.Diacritic).Elem(), "Digit": reflect.ValueOf(&unicode.Digit).Elem(), + "Dives_Akuru": reflect.ValueOf(&unicode.Dives_Akuru).Elem(), "Dogra": reflect.ValueOf(&unicode.Dogra).Elem(), "Duployan": reflect.ValueOf(&unicode.Duployan).Elem(), "Egyptian_Hieroglyphs": reflect.ValueOf(&unicode.Egyptian_Hieroglyphs).Elem(), @@ -115,6 +118,7 @@ func init() { "Katakana": reflect.ValueOf(&unicode.Katakana).Elem(), "Kayah_Li": reflect.ValueOf(&unicode.Kayah_Li).Elem(), "Kharoshthi": reflect.ValueOf(&unicode.Kharoshthi).Elem(), + "Khitan_Small_Script": reflect.ValueOf(&unicode.Khitan_Small_Script).Elem(), "Khmer": reflect.ValueOf(&unicode.Khmer).Elem(), "Khojki": reflect.ValueOf(&unicode.Khojki).Elem(), "Khudawadi": reflect.ValueOf(&unicode.Khudawadi).Elem(), @@ -279,10 +283,11 @@ func init() { "UpperLower": reflect.ValueOf(constant.MakeFromLiteral("1114112", token.INT, 0)), "Vai": reflect.ValueOf(&unicode.Vai).Elem(), "Variation_Selector": reflect.ValueOf(&unicode.Variation_Selector).Elem(), - "Version": reflect.ValueOf(constant.MakeFromLiteral("\"12.0.0\"", token.STRING, 0)), + "Version": reflect.ValueOf(constant.MakeFromLiteral("\"13.0.0\"", token.STRING, 0)), "Wancho": reflect.ValueOf(&unicode.Wancho).Elem(), "Warang_Citi": reflect.ValueOf(&unicode.Warang_Citi).Elem(), "White_Space": reflect.ValueOf(&unicode.White_Space).Elem(), + "Yezidi": reflect.ValueOf(&unicode.Yezidi).Elem(), "Yi": reflect.ValueOf(&unicode.Yi).Elem(), "Z": reflect.ValueOf(&unicode.Z).Elem(), "Zanabazar_Square": reflect.ValueOf(&unicode.Zanabazar_Square).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf16.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf16.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf16.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf16.go index 5df6c63..977ee4c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf16.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf16.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode/utf16'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["unicode/utf16"] = map[string]reflect.Value{ + Symbols["unicode/utf16/utf16"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(utf16.Decode), "DecodeRune": reflect.ValueOf(utf16.DecodeRune), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf8.go b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf8.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf8.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf8.go index 98d1c9c..f8209c2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode_utf8.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_18_unicode_utf8.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode/utf8'. DO NOT EDIT. -// +build go1.16 +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 package stdlib @@ -12,8 +13,9 @@ import ( ) func init() { - Symbols["unicode/utf8"] = map[string]reflect.Value{ + Symbols["unicode/utf8/utf8"] = map[string]reflect.Value{ // function, constant and variable definitions + "AppendRune": reflect.ValueOf(utf8.AppendRune), "DecodeLastRune": reflect.ValueOf(utf8.DecodeLastRune), "DecodeLastRuneInString": reflect.ValueOf(utf8.DecodeLastRuneInString), "DecodeRune": reflect.ValueOf(utf8.DecodeRune), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_tar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_tar.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_tar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_tar.go index cf36f2f..14cb077 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_tar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_tar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract archive/tar'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["archive/tar"] = map[string]reflect.Value{ + Symbols["archive/tar/tar"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrFieldTooLong": reflect.ValueOf(&tar.ErrFieldTooLong).Elem(), "ErrHeader": reflect.ValueOf(&tar.ErrHeader).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_zip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_zip.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_zip.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_zip.go index f1467b4..5e904a7 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_archive_zip.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_archive_zip.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract archive/zip'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["archive/zip"] = map[string]reflect.Value{ + Symbols["archive/zip/zip"] = map[string]reflect.Value{ // function, constant and variable definitions "Deflate": reflect.ValueOf(zip.Deflate), "ErrAlgorithm": reflect.ValueOf(&zip.ErrAlgorithm).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_bufio.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_bufio.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_bufio.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_bufio.go index 7ad464a..26bff86 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_bufio.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_bufio.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract bufio'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["bufio"] = map[string]reflect.Value{ + Symbols["bufio/bufio"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrAdvanceTooFar": reflect.ValueOf(&bufio.ErrAdvanceTooFar).Elem(), "ErrBadReadCount": reflect.ValueOf(&bufio.ErrBadReadCount).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_bytes.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_bytes.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_bytes.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_bytes.go index 2f046cb..11b1d62 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_bytes.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_bytes.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract bytes'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,13 +13,14 @@ import ( ) func init() { - Symbols["bytes"] = map[string]reflect.Value{ + Symbols["bytes/bytes"] = map[string]reflect.Value{ // function, constant and variable definitions "Compare": reflect.ValueOf(bytes.Compare), "Contains": reflect.ValueOf(bytes.Contains), "ContainsAny": reflect.ValueOf(bytes.ContainsAny), "ContainsRune": reflect.ValueOf(bytes.ContainsRune), "Count": reflect.ValueOf(bytes.Count), + "Cut": reflect.ValueOf(bytes.Cut), "Equal": reflect.ValueOf(bytes.Equal), "EqualFold": reflect.ValueOf(bytes.EqualFold), "ErrTooLarge": reflect.ValueOf(&bytes.ErrTooLarge).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_bzip2.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_bzip2.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_bzip2.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_bzip2.go index 231d72d..2194693 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_bzip2.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_bzip2.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/bzip2'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["compress/bzip2"] = map[string]reflect.Value{ + Symbols["compress/bzip2/bzip2"] = map[string]reflect.Value{ // function, constant and variable definitions "NewReader": reflect.ValueOf(bzip2.NewReader), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_flate.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_flate.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_flate.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_flate.go index 9b36e57..4498a40 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_flate.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_flate.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/flate'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["compress/flate"] = map[string]reflect.Value{ + Symbols["compress/flate/flate"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), @@ -42,16 +43,24 @@ func init() { // _compress_flate_Reader is an interface wrapper for Reader type type _compress_flate_Reader struct { + IValue interface{} WRead func(p []byte) (n int, err error) WReadByte func() (byte, error) } -func (W _compress_flate_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _compress_flate_Reader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _compress_flate_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _compress_flate_Reader) ReadByte() (byte, error) { + return W.WReadByte() +} // _compress_flate_Resetter is an interface wrapper for Resetter type type _compress_flate_Resetter struct { + IValue interface{} WReset func(r io.Reader, dict []byte) error } -func (W _compress_flate_Resetter) Reset(r io.Reader, dict []byte) error { return W.WReset(r, dict) } +func (W _compress_flate_Resetter) Reset(r io.Reader, dict []byte) error { + return W.WReset(r, dict) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_gzip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_gzip.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_gzip.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_gzip.go index 6371f00..29455b8 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_gzip.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_gzip.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/gzip'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["compress/gzip"] = map[string]reflect.Value{ + Symbols["compress/gzip/gzip"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_lzw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_lzw.go similarity index 61% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_lzw.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_lzw.go index eb32a29..0cd6d8c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_compress_lzw.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_lzw.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/lzw'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["compress/lzw"] = map[string]reflect.Value{ + Symbols["compress/lzw/lzw"] = map[string]reflect.Value{ // function, constant and variable definitions "LSB": reflect.ValueOf(lzw.LSB), "MSB": reflect.ValueOf(lzw.MSB), @@ -18,6 +19,8 @@ func init() { "NewWriter": reflect.ValueOf(lzw.NewWriter), // type definitions - "Order": reflect.ValueOf((*lzw.Order)(nil)), + "Order": reflect.ValueOf((*lzw.Order)(nil)), + "Reader": reflect.ValueOf((*lzw.Reader)(nil)), + "Writer": reflect.ValueOf((*lzw.Writer)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_zlib.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_zlib.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_zlib.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_zlib.go index 36d8d7d..667209d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_compress_zlib.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_compress_zlib.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract compress/zlib'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["compress/zlib"] = map[string]reflect.Value{ + Symbols["compress/zlib/zlib"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(constant.MakeFromLiteral("9", token.INT, 0)), "BestSpeed": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), @@ -40,7 +41,10 @@ func init() { // _compress_zlib_Resetter is an interface wrapper for Resetter type type _compress_zlib_Resetter struct { + IValue interface{} WReset func(r io.Reader, dict []byte) error } -func (W _compress_zlib_Resetter) Reset(r io.Reader, dict []byte) error { return W.WReset(r, dict) } +func (W _compress_zlib_Resetter) Reset(r io.Reader, dict []byte) error { + return W.WReset(r, dict) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_heap.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_heap.go similarity index 53% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_container_heap.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_container_heap.go index a0ea285..6fa4f09 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_heap.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_heap.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/heap'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/heap"] = map[string]reflect.Value{ + Symbols["container/heap/heap"] = map[string]reflect.Value{ // function, constant and variable definitions "Fix": reflect.ValueOf(heap.Fix), "Init": reflect.ValueOf(heap.Init), @@ -28,15 +29,26 @@ func init() { // _container_heap_Interface is an interface wrapper for Interface type type _container_heap_Interface struct { - WLen func() int - WLess func(i int, j int) bool - WPop func() interface{} - WPush func(x interface{}) - WSwap func(i int, j int) + IValue interface{} + WLen func() int + WLess func(i int, j int) bool + WPop func() any + WPush func(x any) + WSwap func(i int, j int) } -func (W _container_heap_Interface) Len() int { return W.WLen() } -func (W _container_heap_Interface) Less(i int, j int) bool { return W.WLess(i, j) } -func (W _container_heap_Interface) Pop() interface{} { return W.WPop() } -func (W _container_heap_Interface) Push(x interface{}) { W.WPush(x) } -func (W _container_heap_Interface) Swap(i int, j int) { W.WSwap(i, j) } +func (W _container_heap_Interface) Len() int { + return W.WLen() +} +func (W _container_heap_Interface) Less(i int, j int) bool { + return W.WLess(i, j) +} +func (W _container_heap_Interface) Pop() any { + return W.WPop() +} +func (W _container_heap_Interface) Push(x any) { + W.WPush(x) +} +func (W _container_heap_Interface) Swap(i int, j int) { + W.WSwap(i, j) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_list.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_list.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_container_list.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_container_list.go index 73fd1cf..091b326 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_list.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_list.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/list'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/list"] = map[string]reflect.Value{ + Symbols["container/list/list"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(list.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_ring.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_ring.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_container_ring.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_container_ring.go index f7dd4cf..04dde2c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_container_ring.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_container_ring.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract container/ring'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["container/ring"] = map[string]reflect.Value{ + Symbols["container/ring/ring"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(ring.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_context.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_context.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_context.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_context.go index aa2d3a9..4fb21b6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_context.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_context.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract context'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["context"] = map[string]reflect.Value{ + Symbols["context/context"] = map[string]reflect.Value{ // function, constant and variable definitions "Background": reflect.ValueOf(context.Background), "Canceled": reflect.ValueOf(&context.Canceled).Elem(), @@ -33,13 +34,22 @@ func init() { // _context_Context is an interface wrapper for Context type type _context_Context struct { + IValue interface{} WDeadline func() (deadline time.Time, ok bool) WDone func() <-chan struct{} WErr func() error - WValue func(key interface{}) interface{} + WValue func(key any) any } -func (W _context_Context) Deadline() (deadline time.Time, ok bool) { return W.WDeadline() } -func (W _context_Context) Done() <-chan struct{} { return W.WDone() } -func (W _context_Context) Err() error { return W.WErr() } -func (W _context_Context) Value(key interface{}) interface{} { return W.WValue(key) } +func (W _context_Context) Deadline() (deadline time.Time, ok bool) { + return W.WDeadline() +} +func (W _context_Context) Done() <-chan struct{} { + return W.WDone() +} +func (W _context_Context) Err() error { + return W.WErr() +} +func (W _context_Context) Value(key any) any { + return W.WValue(key) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto.go index 4f9efc3..14136dd 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["crypto"] = map[string]reflect.Value{ + Symbols["crypto/crypto"] = map[string]reflect.Value{ // function, constant and variable definitions "BLAKE2b_256": reflect.ValueOf(crypto.BLAKE2b_256), "BLAKE2b_384": reflect.ValueOf(crypto.BLAKE2b_384), @@ -55,6 +56,7 @@ func init() { // _crypto_Decrypter is an interface wrapper for Decrypter type type _crypto_Decrypter struct { + IValue interface{} WDecrypt func(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) WPublic func() crypto.PublicKey } @@ -62,34 +64,45 @@ type _crypto_Decrypter struct { func (W _crypto_Decrypter) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) { return W.WDecrypt(rand, msg, opts) } -func (W _crypto_Decrypter) Public() crypto.PublicKey { return W.WPublic() } +func (W _crypto_Decrypter) Public() crypto.PublicKey { + return W.WPublic() +} // _crypto_DecrypterOpts is an interface wrapper for DecrypterOpts type type _crypto_DecrypterOpts struct { + IValue interface{} } // _crypto_PrivateKey is an interface wrapper for PrivateKey type type _crypto_PrivateKey struct { + IValue interface{} } // _crypto_PublicKey is an interface wrapper for PublicKey type type _crypto_PublicKey struct { + IValue interface{} } // _crypto_Signer is an interface wrapper for Signer type type _crypto_Signer struct { + IValue interface{} WPublic func() crypto.PublicKey WSign func(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) } -func (W _crypto_Signer) Public() crypto.PublicKey { return W.WPublic() } +func (W _crypto_Signer) Public() crypto.PublicKey { + return W.WPublic() +} func (W _crypto_Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) { return W.WSign(rand, digest, opts) } // _crypto_SignerOpts is an interface wrapper for SignerOpts type type _crypto_SignerOpts struct { + IValue interface{} WHashFunc func() crypto.Hash } -func (W _crypto_SignerOpts) HashFunc() crypto.Hash { return W.WHashFunc() } +func (W _crypto_SignerOpts) HashFunc() crypto.Hash { + return W.WHashFunc() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_aes.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_aes.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_aes.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_aes.go index cc3bdd7..d8759bb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_aes.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_aes.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/aes'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/aes"] = map[string]reflect.Value{ + Symbols["crypto/aes/aes"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("16", token.INT, 0)), "NewCipher": reflect.ValueOf(aes.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_cipher.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_cipher.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_cipher.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_cipher.go index f0b3bcc..0ad18c4 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_cipher.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_cipher.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/cipher'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/cipher"] = map[string]reflect.Value{ + Symbols["crypto/cipher/cipher"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCBCDecrypter": reflect.ValueOf(cipher.NewCBCDecrypter), "NewCBCEncrypter": reflect.ValueOf(cipher.NewCBCEncrypter), @@ -40,44 +41,64 @@ func init() { // _crypto_cipher_AEAD is an interface wrapper for AEAD type type _crypto_cipher_AEAD struct { + IValue interface{} WNonceSize func() int WOpen func(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) WOverhead func() int WSeal func(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte } -func (W _crypto_cipher_AEAD) NonceSize() int { return W.WNonceSize() } +func (W _crypto_cipher_AEAD) NonceSize() int { + return W.WNonceSize() +} func (W _crypto_cipher_AEAD) Open(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) { return W.WOpen(dst, nonce, ciphertext, additionalData) } -func (W _crypto_cipher_AEAD) Overhead() int { return W.WOverhead() } +func (W _crypto_cipher_AEAD) Overhead() int { + return W.WOverhead() +} func (W _crypto_cipher_AEAD) Seal(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte { return W.WSeal(dst, nonce, plaintext, additionalData) } // _crypto_cipher_Block is an interface wrapper for Block type type _crypto_cipher_Block struct { + IValue interface{} WBlockSize func() int WDecrypt func(dst []byte, src []byte) WEncrypt func(dst []byte, src []byte) } -func (W _crypto_cipher_Block) BlockSize() int { return W.WBlockSize() } -func (W _crypto_cipher_Block) Decrypt(dst []byte, src []byte) { W.WDecrypt(dst, src) } -func (W _crypto_cipher_Block) Encrypt(dst []byte, src []byte) { W.WEncrypt(dst, src) } +func (W _crypto_cipher_Block) BlockSize() int { + return W.WBlockSize() +} +func (W _crypto_cipher_Block) Decrypt(dst []byte, src []byte) { + W.WDecrypt(dst, src) +} +func (W _crypto_cipher_Block) Encrypt(dst []byte, src []byte) { + W.WEncrypt(dst, src) +} // _crypto_cipher_BlockMode is an interface wrapper for BlockMode type type _crypto_cipher_BlockMode struct { + IValue interface{} WBlockSize func() int WCryptBlocks func(dst []byte, src []byte) } -func (W _crypto_cipher_BlockMode) BlockSize() int { return W.WBlockSize() } -func (W _crypto_cipher_BlockMode) CryptBlocks(dst []byte, src []byte) { W.WCryptBlocks(dst, src) } +func (W _crypto_cipher_BlockMode) BlockSize() int { + return W.WBlockSize() +} +func (W _crypto_cipher_BlockMode) CryptBlocks(dst []byte, src []byte) { + W.WCryptBlocks(dst, src) +} // _crypto_cipher_Stream is an interface wrapper for Stream type type _crypto_cipher_Stream struct { + IValue interface{} WXORKeyStream func(dst []byte, src []byte) } -func (W _crypto_cipher_Stream) XORKeyStream(dst []byte, src []byte) { W.WXORKeyStream(dst, src) } +func (W _crypto_cipher_Stream) XORKeyStream(dst []byte, src []byte) { + W.WXORKeyStream(dst, src) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_des.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_des.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_des.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_des.go index 3a0717f..9bf7073 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_des.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_des.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/des'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/des"] = map[string]reflect.Value{ + Symbols["crypto/des/des"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("8", token.INT, 0)), "NewCipher": reflect.ValueOf(des.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_dsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_dsa.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_dsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_dsa.go index e22314a..2953baa 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_dsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_dsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/dsa'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/dsa"] = map[string]reflect.Value{ + Symbols["crypto/dsa/dsa"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrInvalidPublicKey": reflect.ValueOf(&dsa.ErrInvalidPublicKey).Elem(), "GenerateKey": reflect.ValueOf(dsa.GenerateKey), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ecdsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ecdsa.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ecdsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ecdsa.go index 087aa91..63a0cd2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_ecdsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ecdsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/ecdsa'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/ecdsa"] = map[string]reflect.Value{ + Symbols["crypto/ecdsa/ecdsa"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(ecdsa.GenerateKey), "Sign": reflect.ValueOf(ecdsa.Sign), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ed25519.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ed25519.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ed25519.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ed25519.go index 4c9a37d..6a894a1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_ed25519.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_ed25519.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/ed25519'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/ed25519"] = map[string]reflect.Value{ + Symbols["crypto/ed25519/ed25519"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(ed25519.GenerateKey), "NewKeyFromSeed": reflect.ValueOf(ed25519.NewKeyFromSeed), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_elliptic.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_elliptic.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_elliptic.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_elliptic.go index 33aa647..457b79e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_elliptic.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_elliptic.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/elliptic'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["crypto/elliptic"] = map[string]reflect.Value{ + Symbols["crypto/elliptic/elliptic"] = map[string]reflect.Value{ // function, constant and variable definitions "GenerateKey": reflect.ValueOf(elliptic.GenerateKey), "Marshal": reflect.ValueOf(elliptic.Marshal), @@ -34,6 +35,7 @@ func init() { // _crypto_elliptic_Curve is an interface wrapper for Curve type type _crypto_elliptic_Curve struct { + IValue interface{} WAdd func(x1 *big.Int, y1 *big.Int, x2 *big.Int, y2 *big.Int) (x *big.Int, y *big.Int) WDouble func(x1 *big.Int, y1 *big.Int) (x *big.Int, y *big.Int) WIsOnCurve func(x *big.Int, y *big.Int) bool @@ -48,8 +50,12 @@ func (W _crypto_elliptic_Curve) Add(x1 *big.Int, y1 *big.Int, x2 *big.Int, y2 *b func (W _crypto_elliptic_Curve) Double(x1 *big.Int, y1 *big.Int) (x *big.Int, y *big.Int) { return W.WDouble(x1, y1) } -func (W _crypto_elliptic_Curve) IsOnCurve(x *big.Int, y *big.Int) bool { return W.WIsOnCurve(x, y) } -func (W _crypto_elliptic_Curve) Params() *elliptic.CurveParams { return W.WParams() } +func (W _crypto_elliptic_Curve) IsOnCurve(x *big.Int, y *big.Int) bool { + return W.WIsOnCurve(x, y) +} +func (W _crypto_elliptic_Curve) Params() *elliptic.CurveParams { + return W.WParams() +} func (W _crypto_elliptic_Curve) ScalarBaseMult(k []byte) (x *big.Int, y *big.Int) { return W.WScalarBaseMult(k) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_hmac.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_hmac.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_hmac.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_hmac.go index 23a674e..4c7cc8c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_hmac.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_hmac.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/hmac'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/hmac"] = map[string]reflect.Value{ + Symbols["crypto/hmac/hmac"] = map[string]reflect.Value{ // function, constant and variable definitions "Equal": reflect.ValueOf(hmac.Equal), "New": reflect.ValueOf(hmac.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_md5.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_md5.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_md5.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_md5.go index 298e182..65dd55d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_md5.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_md5.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/md5'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/md5"] = map[string]reflect.Value{ + Symbols["crypto/md5/md5"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(md5.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rand.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rand.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rand.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rand.go index 5a83e12..738d950 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_rand.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rand.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rand'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/rand"] = map[string]reflect.Value{ + Symbols["crypto/rand/rand"] = map[string]reflect.Value{ // function, constant and variable definitions "Int": reflect.ValueOf(rand.Int), "Prime": reflect.ValueOf(rand.Prime), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rc4.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rc4.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rc4.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rc4.go index af317ed..8ad98fb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rc4.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rc4.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rc4'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/rc4"] = map[string]reflect.Value{ + Symbols["crypto/rc4/rc4"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCipher": reflect.ValueOf(rc4.NewCipher), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rsa.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rsa.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rsa.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rsa.go index 06169a0..064e096 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_rsa.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_rsa.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/rsa'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/rsa"] = map[string]reflect.Value{ + Symbols["crypto/rsa/rsa"] = map[string]reflect.Value{ // function, constant and variable definitions "DecryptOAEP": reflect.ValueOf(rsa.DecryptOAEP), "DecryptPKCS1v15": reflect.ValueOf(rsa.DecryptPKCS1v15), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha1.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha1.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha1.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha1.go index 00ce818..3da9941 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha1.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha1.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha1'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha1"] = map[string]reflect.Value{ + Symbols["crypto/sha1/sha1"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(sha1.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha256.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha256.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha256.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha256.go index 295004a..0e5ce87 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_sha256.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha256.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha256'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha256"] = map[string]reflect.Value{ + Symbols["crypto/sha256/sha256"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), "New": reflect.ValueOf(sha256.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha512.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha512.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha512.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha512.go index 5bacb1a..5ac4b0d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_sha512.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_sha512.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/sha512'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/sha512"] = map[string]reflect.Value{ + Symbols["crypto/sha512/sha512"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockSize": reflect.ValueOf(constant.MakeFromLiteral("128", token.INT, 0)), "New": reflect.ValueOf(sha512.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_subtle.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_subtle.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_subtle.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_subtle.go index 82249ab..bc9928c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_subtle.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_subtle.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/subtle'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/subtle"] = map[string]reflect.Value{ + Symbols["crypto/subtle/subtle"] = map[string]reflect.Value{ // function, constant and variable definitions "ConstantTimeByteEq": reflect.ValueOf(subtle.ConstantTimeByteEq), "ConstantTimeCompare": reflect.ValueOf(subtle.ConstantTimeCompare), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_tls.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_tls.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_tls.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_tls.go index e56b8bb..6bcdbdc 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_tls.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_tls.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/tls'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["crypto/tls"] = map[string]reflect.Value{ + Symbols["crypto/tls/tls"] = map[string]reflect.Value{ // function, constant and variable definitions "CipherSuiteName": reflect.ValueOf(tls.CipherSuiteName), "CipherSuites": reflect.ValueOf(tls.CipherSuites), @@ -108,8 +109,9 @@ func init() { // _crypto_tls_ClientSessionCache is an interface wrapper for ClientSessionCache type type _crypto_tls_ClientSessionCache struct { - WGet func(sessionKey string) (session *tls.ClientSessionState, ok bool) - WPut func(sessionKey string, cs *tls.ClientSessionState) + IValue interface{} + WGet func(sessionKey string) (session *tls.ClientSessionState, ok bool) + WPut func(sessionKey string, cs *tls.ClientSessionState) } func (W _crypto_tls_ClientSessionCache) Get(sessionKey string) (session *tls.ClientSessionState, ok bool) { diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509.go similarity index 98% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509.go index 60e4b1c..3f4eb66 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_crypto_x509.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/x509'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/x509"] = map[string]reflect.Value{ + Symbols["crypto/x509/x509"] = map[string]reflect.Value{ // function, constant and variable definitions "CANotAuthorizedForExtKeyUsage": reflect.ValueOf(x509.CANotAuthorizedForExtKeyUsage), "CANotAuthorizedForThisName": reflect.ValueOf(x509.CANotAuthorizedForThisName), @@ -82,6 +83,7 @@ func init() { "ParsePKCS1PublicKey": reflect.ValueOf(x509.ParsePKCS1PublicKey), "ParsePKCS8PrivateKey": reflect.ValueOf(x509.ParsePKCS8PrivateKey), "ParsePKIXPublicKey": reflect.ValueOf(x509.ParsePKIXPublicKey), + "ParseRevocationList": reflect.ValueOf(x509.ParseRevocationList), "PureEd25519": reflect.ValueOf(x509.PureEd25519), "RSA": reflect.ValueOf(x509.RSA), "SHA1WithRSA": reflect.ValueOf(x509.SHA1WithRSA), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509_pkix.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509_pkix.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509_pkix.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509_pkix.go index ebc9294..d238351 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_crypto_x509_pkix.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_crypto_x509_pkix.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract crypto/x509/pkix'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["crypto/x509/pkix"] = map[string]reflect.Value{ + Symbols["crypto/x509/pkix/pkix"] = map[string]reflect.Value{ // type definitions "AlgorithmIdentifier": reflect.ValueOf((*pkix.AlgorithmIdentifier)(nil)), "AttributeTypeAndValue": reflect.ValueOf((*pkix.AttributeTypeAndValue)(nil)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql.go index 5ac2208..cb7fb1b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract database/sql'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["database/sql"] = map[string]reflect.Value{ + Symbols["database/sql/sql"] = map[string]reflect.Value{ // function, constant and variable definitions "Drivers": reflect.ValueOf(sql.Drivers), "ErrConnDone": reflect.ValueOf(&sql.ErrConnDone).Elem(), @@ -37,7 +38,9 @@ func init() { "IsolationLevel": reflect.ValueOf((*sql.IsolationLevel)(nil)), "NamedArg": reflect.ValueOf((*sql.NamedArg)(nil)), "NullBool": reflect.ValueOf((*sql.NullBool)(nil)), + "NullByte": reflect.ValueOf((*sql.NullByte)(nil)), "NullFloat64": reflect.ValueOf((*sql.NullFloat64)(nil)), + "NullInt16": reflect.ValueOf((*sql.NullInt16)(nil)), "NullInt32": reflect.ValueOf((*sql.NullInt32)(nil)), "NullInt64": reflect.ValueOf((*sql.NullInt64)(nil)), "NullString": reflect.ValueOf((*sql.NullString)(nil)), @@ -60,16 +63,24 @@ func init() { // _database_sql_Result is an interface wrapper for Result type type _database_sql_Result struct { + IValue interface{} WLastInsertId func() (int64, error) WRowsAffected func() (int64, error) } -func (W _database_sql_Result) LastInsertId() (int64, error) { return W.WLastInsertId() } -func (W _database_sql_Result) RowsAffected() (int64, error) { return W.WRowsAffected() } +func (W _database_sql_Result) LastInsertId() (int64, error) { + return W.WLastInsertId() +} +func (W _database_sql_Result) RowsAffected() (int64, error) { + return W.WRowsAffected() +} // _database_sql_Scanner is an interface wrapper for Scanner type type _database_sql_Scanner struct { - WScan func(src interface{}) error + IValue interface{} + WScan func(src any) error } -func (W _database_sql_Scanner) Scan(src interface{}) error { return W.WScan(src) } +func (W _database_sql_Scanner) Scan(src any) error { + return W.WScan(src) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql_driver.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql_driver.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql_driver.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql_driver.go index 7ba5d3f..ddff2db 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_database_sql_driver.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_database_sql_driver.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract database/sql/driver'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["database/sql/driver"] = map[string]reflect.Value{ + Symbols["database/sql/driver/driver"] = map[string]reflect.Value{ // function, constant and variable definitions "Bool": reflect.ValueOf(&driver.Bool).Elem(), "DefaultParameterConverter": reflect.ValueOf(&driver.DefaultParameterConverter).Elem(), @@ -98,6 +99,7 @@ func init() { // _database_sql_driver_ColumnConverter is an interface wrapper for ColumnConverter type type _database_sql_driver_ColumnConverter struct { + IValue interface{} WColumnConverter func(idx int) driver.ValueConverter } @@ -107,19 +109,25 @@ func (W _database_sql_driver_ColumnConverter) ColumnConverter(idx int) driver.Va // _database_sql_driver_Conn is an interface wrapper for Conn type type _database_sql_driver_Conn struct { + IValue interface{} WBegin func() (driver.Tx, error) WClose func() error WPrepare func(query string) (driver.Stmt, error) } -func (W _database_sql_driver_Conn) Begin() (driver.Tx, error) { return W.WBegin() } -func (W _database_sql_driver_Conn) Close() error { return W.WClose() } +func (W _database_sql_driver_Conn) Begin() (driver.Tx, error) { + return W.WBegin() +} +func (W _database_sql_driver_Conn) Close() error { + return W.WClose() +} func (W _database_sql_driver_Conn) Prepare(query string) (driver.Stmt, error) { return W.WPrepare(query) } // _database_sql_driver_ConnBeginTx is an interface wrapper for ConnBeginTx type type _database_sql_driver_ConnBeginTx struct { + IValue interface{} WBeginTx func(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) } @@ -129,6 +137,7 @@ func (W _database_sql_driver_ConnBeginTx) BeginTx(ctx context.Context, opts driv // _database_sql_driver_ConnPrepareContext is an interface wrapper for ConnPrepareContext type type _database_sql_driver_ConnPrepareContext struct { + IValue interface{} WPrepareContext func(ctx context.Context, query string) (driver.Stmt, error) } @@ -138,6 +147,7 @@ func (W _database_sql_driver_ConnPrepareContext) PrepareContext(ctx context.Cont // _database_sql_driver_Connector is an interface wrapper for Connector type type _database_sql_driver_Connector struct { + IValue interface{} WConnect func(a0 context.Context) (driver.Conn, error) WDriver func() driver.Driver } @@ -145,17 +155,23 @@ type _database_sql_driver_Connector struct { func (W _database_sql_driver_Connector) Connect(a0 context.Context) (driver.Conn, error) { return W.WConnect(a0) } -func (W _database_sql_driver_Connector) Driver() driver.Driver { return W.WDriver() } +func (W _database_sql_driver_Connector) Driver() driver.Driver { + return W.WDriver() +} // _database_sql_driver_Driver is an interface wrapper for Driver type type _database_sql_driver_Driver struct { - WOpen func(name string) (driver.Conn, error) + IValue interface{} + WOpen func(name string) (driver.Conn, error) } -func (W _database_sql_driver_Driver) Open(name string) (driver.Conn, error) { return W.WOpen(name) } +func (W _database_sql_driver_Driver) Open(name string) (driver.Conn, error) { + return W.WOpen(name) +} // _database_sql_driver_DriverContext is an interface wrapper for DriverContext type type _database_sql_driver_DriverContext struct { + IValue interface{} WOpenConnector func(name string) (driver.Connector, error) } @@ -165,7 +181,8 @@ func (W _database_sql_driver_DriverContext) OpenConnector(name string) (driver.C // _database_sql_driver_Execer is an interface wrapper for Execer type type _database_sql_driver_Execer struct { - WExec func(query string, args []driver.Value) (driver.Result, error) + IValue interface{} + WExec func(query string, args []driver.Value) (driver.Result, error) } func (W _database_sql_driver_Execer) Exec(query string, args []driver.Value) (driver.Result, error) { @@ -174,6 +191,7 @@ func (W _database_sql_driver_Execer) Exec(query string, args []driver.Value) (dr // _database_sql_driver_ExecerContext is an interface wrapper for ExecerContext type type _database_sql_driver_ExecerContext struct { + IValue interface{} WExecContext func(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) } @@ -183,6 +201,7 @@ func (W _database_sql_driver_ExecerContext) ExecContext(ctx context.Context, que // _database_sql_driver_NamedValueChecker is an interface wrapper for NamedValueChecker type type _database_sql_driver_NamedValueChecker struct { + IValue interface{} WCheckNamedValue func(a0 *driver.NamedValue) error } @@ -192,13 +211,17 @@ func (W _database_sql_driver_NamedValueChecker) CheckNamedValue(a0 *driver.Named // _database_sql_driver_Pinger is an interface wrapper for Pinger type type _database_sql_driver_Pinger struct { - WPing func(ctx context.Context) error + IValue interface{} + WPing func(ctx context.Context) error } -func (W _database_sql_driver_Pinger) Ping(ctx context.Context) error { return W.WPing(ctx) } +func (W _database_sql_driver_Pinger) Ping(ctx context.Context) error { + return W.WPing(ctx) +} // _database_sql_driver_Queryer is an interface wrapper for Queryer type type _database_sql_driver_Queryer struct { + IValue interface{} WQuery func(query string, args []driver.Value) (driver.Rows, error) } @@ -208,6 +231,7 @@ func (W _database_sql_driver_Queryer) Query(query string, args []driver.Value) ( // _database_sql_driver_QueryerContext is an interface wrapper for QueryerContext type type _database_sql_driver_QueryerContext struct { + IValue interface{} WQueryContext func(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) } @@ -217,111 +241,149 @@ func (W _database_sql_driver_QueryerContext) QueryContext(ctx context.Context, q // _database_sql_driver_Result is an interface wrapper for Result type type _database_sql_driver_Result struct { + IValue interface{} WLastInsertId func() (int64, error) WRowsAffected func() (int64, error) } -func (W _database_sql_driver_Result) LastInsertId() (int64, error) { return W.WLastInsertId() } -func (W _database_sql_driver_Result) RowsAffected() (int64, error) { return W.WRowsAffected() } +func (W _database_sql_driver_Result) LastInsertId() (int64, error) { + return W.WLastInsertId() +} +func (W _database_sql_driver_Result) RowsAffected() (int64, error) { + return W.WRowsAffected() +} // _database_sql_driver_Rows is an interface wrapper for Rows type type _database_sql_driver_Rows struct { + IValue interface{} WClose func() error WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_Rows) Close() error { return W.WClose() } -func (W _database_sql_driver_Rows) Columns() []string { return W.WColumns() } -func (W _database_sql_driver_Rows) Next(dest []driver.Value) error { return W.WNext(dest) } +func (W _database_sql_driver_Rows) Close() error { + return W.WClose() +} +func (W _database_sql_driver_Rows) Columns() []string { + return W.WColumns() +} +func (W _database_sql_driver_Rows) Next(dest []driver.Value) error { + return W.WNext(dest) +} // _database_sql_driver_RowsColumnTypeDatabaseTypeName is an interface wrapper for RowsColumnTypeDatabaseTypeName type type _database_sql_driver_RowsColumnTypeDatabaseTypeName struct { + IValue interface{} WClose func() error WColumnTypeDatabaseTypeName func(index int) string WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) ColumnTypeDatabaseTypeName(index int) string { return W.WColumnTypeDatabaseTypeName(index) } -func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeDatabaseTypeName) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeLength is an interface wrapper for RowsColumnTypeLength type type _database_sql_driver_RowsColumnTypeLength struct { + IValue interface{} WClose func() error WColumnTypeLength func(index int) (length int64, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeLength) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeLength) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeLength) ColumnTypeLength(index int) (length int64, ok bool) { return W.WColumnTypeLength(index) } -func (W _database_sql_driver_RowsColumnTypeLength) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeLength) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeLength) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeNullable is an interface wrapper for RowsColumnTypeNullable type type _database_sql_driver_RowsColumnTypeNullable struct { + IValue interface{} WClose func() error WColumnTypeNullable func(index int) (nullable bool, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeNullable) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeNullable) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeNullable) ColumnTypeNullable(index int) (nullable bool, ok bool) { return W.WColumnTypeNullable(index) } -func (W _database_sql_driver_RowsColumnTypeNullable) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeNullable) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeNullable) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypePrecisionScale is an interface wrapper for RowsColumnTypePrecisionScale type type _database_sql_driver_RowsColumnTypePrecisionScale struct { + IValue interface{} WClose func() error WColumnTypePrecisionScale func(index int) (precision int64, scale int64, ok bool) WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypePrecisionScale) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypePrecisionScale) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypePrecisionScale) ColumnTypePrecisionScale(index int) (precision int64, scale int64, ok bool) { return W.WColumnTypePrecisionScale(index) } -func (W _database_sql_driver_RowsColumnTypePrecisionScale) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypePrecisionScale) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypePrecisionScale) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsColumnTypeScanType is an interface wrapper for RowsColumnTypeScanType type type _database_sql_driver_RowsColumnTypeScanType struct { + IValue interface{} WClose func() error WColumnTypeScanType func(index int) reflect.Type WColumns func() []string WNext func(dest []driver.Value) error } -func (W _database_sql_driver_RowsColumnTypeScanType) Close() error { return W.WClose() } +func (W _database_sql_driver_RowsColumnTypeScanType) Close() error { + return W.WClose() +} func (W _database_sql_driver_RowsColumnTypeScanType) ColumnTypeScanType(index int) reflect.Type { return W.WColumnTypeScanType(index) } -func (W _database_sql_driver_RowsColumnTypeScanType) Columns() []string { return W.WColumns() } +func (W _database_sql_driver_RowsColumnTypeScanType) Columns() []string { + return W.WColumns() +} func (W _database_sql_driver_RowsColumnTypeScanType) Next(dest []driver.Value) error { return W.WNext(dest) } // _database_sql_driver_RowsNextResultSet is an interface wrapper for RowsNextResultSet type type _database_sql_driver_RowsNextResultSet struct { + IValue interface{} WClose func() error WColumns func() []string WHasNextResultSet func() bool @@ -329,14 +391,25 @@ type _database_sql_driver_RowsNextResultSet struct { WNextResultSet func() error } -func (W _database_sql_driver_RowsNextResultSet) Close() error { return W.WClose() } -func (W _database_sql_driver_RowsNextResultSet) Columns() []string { return W.WColumns() } -func (W _database_sql_driver_RowsNextResultSet) HasNextResultSet() bool { return W.WHasNextResultSet() } -func (W _database_sql_driver_RowsNextResultSet) Next(dest []driver.Value) error { return W.WNext(dest) } -func (W _database_sql_driver_RowsNextResultSet) NextResultSet() error { return W.WNextResultSet() } +func (W _database_sql_driver_RowsNextResultSet) Close() error { + return W.WClose() +} +func (W _database_sql_driver_RowsNextResultSet) Columns() []string { + return W.WColumns() +} +func (W _database_sql_driver_RowsNextResultSet) HasNextResultSet() bool { + return W.WHasNextResultSet() +} +func (W _database_sql_driver_RowsNextResultSet) Next(dest []driver.Value) error { + return W.WNext(dest) +} +func (W _database_sql_driver_RowsNextResultSet) NextResultSet() error { + return W.WNextResultSet() +} // _database_sql_driver_SessionResetter is an interface wrapper for SessionResetter type type _database_sql_driver_SessionResetter struct { + IValue interface{} WResetSession func(ctx context.Context) error } @@ -346,23 +419,29 @@ func (W _database_sql_driver_SessionResetter) ResetSession(ctx context.Context) // _database_sql_driver_Stmt is an interface wrapper for Stmt type type _database_sql_driver_Stmt struct { + IValue interface{} WClose func() error WExec func(args []driver.Value) (driver.Result, error) WNumInput func() int WQuery func(args []driver.Value) (driver.Rows, error) } -func (W _database_sql_driver_Stmt) Close() error { return W.WClose() } +func (W _database_sql_driver_Stmt) Close() error { + return W.WClose() +} func (W _database_sql_driver_Stmt) Exec(args []driver.Value) (driver.Result, error) { return W.WExec(args) } -func (W _database_sql_driver_Stmt) NumInput() int { return W.WNumInput() } +func (W _database_sql_driver_Stmt) NumInput() int { + return W.WNumInput() +} func (W _database_sql_driver_Stmt) Query(args []driver.Value) (driver.Rows, error) { return W.WQuery(args) } // _database_sql_driver_StmtExecContext is an interface wrapper for StmtExecContext type type _database_sql_driver_StmtExecContext struct { + IValue interface{} WExecContext func(ctx context.Context, args []driver.NamedValue) (driver.Result, error) } @@ -372,6 +451,7 @@ func (W _database_sql_driver_StmtExecContext) ExecContext(ctx context.Context, a // _database_sql_driver_StmtQueryContext is an interface wrapper for StmtQueryContext type type _database_sql_driver_StmtQueryContext struct { + IValue interface{} WQueryContext func(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) } @@ -381,36 +461,49 @@ func (W _database_sql_driver_StmtQueryContext) QueryContext(ctx context.Context, // _database_sql_driver_Tx is an interface wrapper for Tx type type _database_sql_driver_Tx struct { + IValue interface{} WCommit func() error WRollback func() error } -func (W _database_sql_driver_Tx) Commit() error { return W.WCommit() } -func (W _database_sql_driver_Tx) Rollback() error { return W.WRollback() } +func (W _database_sql_driver_Tx) Commit() error { + return W.WCommit() +} +func (W _database_sql_driver_Tx) Rollback() error { + return W.WRollback() +} // _database_sql_driver_Validator is an interface wrapper for Validator type type _database_sql_driver_Validator struct { + IValue interface{} WIsValid func() bool } -func (W _database_sql_driver_Validator) IsValid() bool { return W.WIsValid() } +func (W _database_sql_driver_Validator) IsValid() bool { + return W.WIsValid() +} // _database_sql_driver_Value is an interface wrapper for Value type type _database_sql_driver_Value struct { + IValue interface{} } // _database_sql_driver_ValueConverter is an interface wrapper for ValueConverter type type _database_sql_driver_ValueConverter struct { - WConvertValue func(v interface{}) (driver.Value, error) + IValue interface{} + WConvertValue func(v any) (driver.Value, error) } -func (W _database_sql_driver_ValueConverter) ConvertValue(v interface{}) (driver.Value, error) { +func (W _database_sql_driver_ValueConverter) ConvertValue(v any) (driver.Value, error) { return W.WConvertValue(v) } // _database_sql_driver_Valuer is an interface wrapper for Valuer type type _database_sql_driver_Valuer struct { + IValue interface{} WValue func() (driver.Value, error) } -func (W _database_sql_driver_Valuer) Value() (driver.Value, error) { return W.WValue() } +func (W _database_sql_driver_Valuer) Value() (driver.Value, error) { + return W.WValue() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_buildinfo.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_buildinfo.go new file mode 100644 index 0000000..5130f61 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_buildinfo.go @@ -0,0 +1,22 @@ +// Code generated by 'yaegi extract debug/buildinfo'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "debug/buildinfo" + "reflect" +) + +func init() { + Symbols["debug/buildinfo/buildinfo"] = map[string]reflect.Value{ + // function, constant and variable definitions + "Read": reflect.ValueOf(buildinfo.Read), + "ReadFile": reflect.ValueOf(buildinfo.ReadFile), + + // type definitions + "BuildInfo": reflect.ValueOf((*buildinfo.BuildInfo)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_dwarf.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_dwarf.go similarity index 98% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_dwarf.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_dwarf.go index 1d289cb..a1f6ad0 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_dwarf.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_dwarf.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/dwarf'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/dwarf"] = map[string]reflect.Value{ + Symbols["debug/dwarf/dwarf"] = map[string]reflect.Value{ // function, constant and variable definitions "AttrAbstractOrigin": reflect.ValueOf(dwarf.AttrAbstractOrigin), "AttrAccessibility": reflect.ValueOf(dwarf.AttrAccessibility), @@ -271,11 +272,21 @@ func init() { // _debug_dwarf_Type is an interface wrapper for Type type type _debug_dwarf_Type struct { + IValue interface{} WCommon func() *dwarf.CommonType WSize func() int64 WString func() string } -func (W _debug_dwarf_Type) Common() *dwarf.CommonType { return W.WCommon() } -func (W _debug_dwarf_Type) Size() int64 { return W.WSize() } -func (W _debug_dwarf_Type) String() string { return W.WString() } +func (W _debug_dwarf_Type) Common() *dwarf.CommonType { + return W.WCommon() +} +func (W _debug_dwarf_Type) Size() int64 { + return W.WSize() +} +func (W _debug_dwarf_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_elf.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_elf.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_elf.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_elf.go index 2b1719e..d4e2998 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_elf.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_elf.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/elf'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["debug/elf"] = map[string]reflect.Value{ + Symbols["debug/elf/elf"] = map[string]reflect.Value{ // function, constant and variable definitions "ARM_MAGIC_TRAMP_NUMBER": reflect.ValueOf(constant.MakeFromLiteral("1543503875", token.INT, 0)), "COMPRESS_HIOS": reflect.ValueOf(elf.COMPRESS_HIOS), @@ -25,13 +26,29 @@ func init() { "DF_STATIC_TLS": reflect.ValueOf(elf.DF_STATIC_TLS), "DF_SYMBOLIC": reflect.ValueOf(elf.DF_SYMBOLIC), "DF_TEXTREL": reflect.ValueOf(elf.DF_TEXTREL), + "DT_ADDRRNGHI": reflect.ValueOf(elf.DT_ADDRRNGHI), + "DT_ADDRRNGLO": reflect.ValueOf(elf.DT_ADDRRNGLO), + "DT_AUDIT": reflect.ValueOf(elf.DT_AUDIT), + "DT_AUXILIARY": reflect.ValueOf(elf.DT_AUXILIARY), "DT_BIND_NOW": reflect.ValueOf(elf.DT_BIND_NOW), + "DT_CHECKSUM": reflect.ValueOf(elf.DT_CHECKSUM), + "DT_CONFIG": reflect.ValueOf(elf.DT_CONFIG), "DT_DEBUG": reflect.ValueOf(elf.DT_DEBUG), + "DT_DEPAUDIT": reflect.ValueOf(elf.DT_DEPAUDIT), "DT_ENCODING": reflect.ValueOf(elf.DT_ENCODING), + "DT_FEATURE": reflect.ValueOf(elf.DT_FEATURE), + "DT_FILTER": reflect.ValueOf(elf.DT_FILTER), "DT_FINI": reflect.ValueOf(elf.DT_FINI), "DT_FINI_ARRAY": reflect.ValueOf(elf.DT_FINI_ARRAY), "DT_FINI_ARRAYSZ": reflect.ValueOf(elf.DT_FINI_ARRAYSZ), "DT_FLAGS": reflect.ValueOf(elf.DT_FLAGS), + "DT_FLAGS_1": reflect.ValueOf(elf.DT_FLAGS_1), + "DT_GNU_CONFLICT": reflect.ValueOf(elf.DT_GNU_CONFLICT), + "DT_GNU_CONFLICTSZ": reflect.ValueOf(elf.DT_GNU_CONFLICTSZ), + "DT_GNU_HASH": reflect.ValueOf(elf.DT_GNU_HASH), + "DT_GNU_LIBLIST": reflect.ValueOf(elf.DT_GNU_LIBLIST), + "DT_GNU_LIBLISTSZ": reflect.ValueOf(elf.DT_GNU_LIBLISTSZ), + "DT_GNU_PRELINKED": reflect.ValueOf(elf.DT_GNU_PRELINKED), "DT_HASH": reflect.ValueOf(elf.DT_HASH), "DT_HIOS": reflect.ValueOf(elf.DT_HIOS), "DT_HIPROC": reflect.ValueOf(elf.DT_HIPROC), @@ -41,28 +58,100 @@ func init() { "DT_JMPREL": reflect.ValueOf(elf.DT_JMPREL), "DT_LOOS": reflect.ValueOf(elf.DT_LOOS), "DT_LOPROC": reflect.ValueOf(elf.DT_LOPROC), + "DT_MIPS_AUX_DYNAMIC": reflect.ValueOf(elf.DT_MIPS_AUX_DYNAMIC), + "DT_MIPS_BASE_ADDRESS": reflect.ValueOf(elf.DT_MIPS_BASE_ADDRESS), + "DT_MIPS_COMPACT_SIZE": reflect.ValueOf(elf.DT_MIPS_COMPACT_SIZE), + "DT_MIPS_CONFLICT": reflect.ValueOf(elf.DT_MIPS_CONFLICT), + "DT_MIPS_CONFLICTNO": reflect.ValueOf(elf.DT_MIPS_CONFLICTNO), + "DT_MIPS_CXX_FLAGS": reflect.ValueOf(elf.DT_MIPS_CXX_FLAGS), + "DT_MIPS_DELTA_CLASS": reflect.ValueOf(elf.DT_MIPS_DELTA_CLASS), + "DT_MIPS_DELTA_CLASSSYM": reflect.ValueOf(elf.DT_MIPS_DELTA_CLASSSYM), + "DT_MIPS_DELTA_CLASSSYM_NO": reflect.ValueOf(elf.DT_MIPS_DELTA_CLASSSYM_NO), + "DT_MIPS_DELTA_CLASS_NO": reflect.ValueOf(elf.DT_MIPS_DELTA_CLASS_NO), + "DT_MIPS_DELTA_INSTANCE": reflect.ValueOf(elf.DT_MIPS_DELTA_INSTANCE), + "DT_MIPS_DELTA_INSTANCE_NO": reflect.ValueOf(elf.DT_MIPS_DELTA_INSTANCE_NO), + "DT_MIPS_DELTA_RELOC": reflect.ValueOf(elf.DT_MIPS_DELTA_RELOC), + "DT_MIPS_DELTA_RELOC_NO": reflect.ValueOf(elf.DT_MIPS_DELTA_RELOC_NO), + "DT_MIPS_DELTA_SYM": reflect.ValueOf(elf.DT_MIPS_DELTA_SYM), + "DT_MIPS_DELTA_SYM_NO": reflect.ValueOf(elf.DT_MIPS_DELTA_SYM_NO), + "DT_MIPS_DYNSTR_ALIGN": reflect.ValueOf(elf.DT_MIPS_DYNSTR_ALIGN), + "DT_MIPS_FLAGS": reflect.ValueOf(elf.DT_MIPS_FLAGS), + "DT_MIPS_GOTSYM": reflect.ValueOf(elf.DT_MIPS_GOTSYM), + "DT_MIPS_GP_VALUE": reflect.ValueOf(elf.DT_MIPS_GP_VALUE), + "DT_MIPS_HIDDEN_GOTIDX": reflect.ValueOf(elf.DT_MIPS_HIDDEN_GOTIDX), + "DT_MIPS_HIPAGENO": reflect.ValueOf(elf.DT_MIPS_HIPAGENO), + "DT_MIPS_ICHECKSUM": reflect.ValueOf(elf.DT_MIPS_ICHECKSUM), + "DT_MIPS_INTERFACE": reflect.ValueOf(elf.DT_MIPS_INTERFACE), + "DT_MIPS_INTERFACE_SIZE": reflect.ValueOf(elf.DT_MIPS_INTERFACE_SIZE), + "DT_MIPS_IVERSION": reflect.ValueOf(elf.DT_MIPS_IVERSION), + "DT_MIPS_LIBLIST": reflect.ValueOf(elf.DT_MIPS_LIBLIST), + "DT_MIPS_LIBLISTNO": reflect.ValueOf(elf.DT_MIPS_LIBLISTNO), + "DT_MIPS_LOCALPAGE_GOTIDX": reflect.ValueOf(elf.DT_MIPS_LOCALPAGE_GOTIDX), + "DT_MIPS_LOCAL_GOTIDX": reflect.ValueOf(elf.DT_MIPS_LOCAL_GOTIDX), + "DT_MIPS_LOCAL_GOTNO": reflect.ValueOf(elf.DT_MIPS_LOCAL_GOTNO), + "DT_MIPS_MSYM": reflect.ValueOf(elf.DT_MIPS_MSYM), + "DT_MIPS_OPTIONS": reflect.ValueOf(elf.DT_MIPS_OPTIONS), + "DT_MIPS_PERF_SUFFIX": reflect.ValueOf(elf.DT_MIPS_PERF_SUFFIX), + "DT_MIPS_PIXIE_INIT": reflect.ValueOf(elf.DT_MIPS_PIXIE_INIT), + "DT_MIPS_PLTGOT": reflect.ValueOf(elf.DT_MIPS_PLTGOT), + "DT_MIPS_PROTECTED_GOTIDX": reflect.ValueOf(elf.DT_MIPS_PROTECTED_GOTIDX), + "DT_MIPS_RLD_MAP": reflect.ValueOf(elf.DT_MIPS_RLD_MAP), + "DT_MIPS_RLD_MAP_REL": reflect.ValueOf(elf.DT_MIPS_RLD_MAP_REL), + "DT_MIPS_RLD_TEXT_RESOLVE_ADDR": reflect.ValueOf(elf.DT_MIPS_RLD_TEXT_RESOLVE_ADDR), + "DT_MIPS_RLD_VERSION": reflect.ValueOf(elf.DT_MIPS_RLD_VERSION), + "DT_MIPS_RWPLT": reflect.ValueOf(elf.DT_MIPS_RWPLT), + "DT_MIPS_SYMBOL_LIB": reflect.ValueOf(elf.DT_MIPS_SYMBOL_LIB), + "DT_MIPS_SYMTABNO": reflect.ValueOf(elf.DT_MIPS_SYMTABNO), + "DT_MIPS_TIME_STAMP": reflect.ValueOf(elf.DT_MIPS_TIME_STAMP), + "DT_MIPS_UNREFEXTNO": reflect.ValueOf(elf.DT_MIPS_UNREFEXTNO), + "DT_MOVEENT": reflect.ValueOf(elf.DT_MOVEENT), + "DT_MOVESZ": reflect.ValueOf(elf.DT_MOVESZ), + "DT_MOVETAB": reflect.ValueOf(elf.DT_MOVETAB), "DT_NEEDED": reflect.ValueOf(elf.DT_NEEDED), "DT_NULL": reflect.ValueOf(elf.DT_NULL), "DT_PLTGOT": reflect.ValueOf(elf.DT_PLTGOT), + "DT_PLTPAD": reflect.ValueOf(elf.DT_PLTPAD), + "DT_PLTPADSZ": reflect.ValueOf(elf.DT_PLTPADSZ), "DT_PLTREL": reflect.ValueOf(elf.DT_PLTREL), "DT_PLTRELSZ": reflect.ValueOf(elf.DT_PLTRELSZ), + "DT_POSFLAG_1": reflect.ValueOf(elf.DT_POSFLAG_1), + "DT_PPC64_GLINK": reflect.ValueOf(elf.DT_PPC64_GLINK), + "DT_PPC64_OPD": reflect.ValueOf(elf.DT_PPC64_OPD), + "DT_PPC64_OPDSZ": reflect.ValueOf(elf.DT_PPC64_OPDSZ), + "DT_PPC64_OPT": reflect.ValueOf(elf.DT_PPC64_OPT), + "DT_PPC_GOT": reflect.ValueOf(elf.DT_PPC_GOT), + "DT_PPC_OPT": reflect.ValueOf(elf.DT_PPC_OPT), "DT_PREINIT_ARRAY": reflect.ValueOf(elf.DT_PREINIT_ARRAY), "DT_PREINIT_ARRAYSZ": reflect.ValueOf(elf.DT_PREINIT_ARRAYSZ), "DT_REL": reflect.ValueOf(elf.DT_REL), "DT_RELA": reflect.ValueOf(elf.DT_RELA), + "DT_RELACOUNT": reflect.ValueOf(elf.DT_RELACOUNT), "DT_RELAENT": reflect.ValueOf(elf.DT_RELAENT), "DT_RELASZ": reflect.ValueOf(elf.DT_RELASZ), + "DT_RELCOUNT": reflect.ValueOf(elf.DT_RELCOUNT), "DT_RELENT": reflect.ValueOf(elf.DT_RELENT), "DT_RELSZ": reflect.ValueOf(elf.DT_RELSZ), "DT_RPATH": reflect.ValueOf(elf.DT_RPATH), "DT_RUNPATH": reflect.ValueOf(elf.DT_RUNPATH), "DT_SONAME": reflect.ValueOf(elf.DT_SONAME), + "DT_SPARC_REGISTER": reflect.ValueOf(elf.DT_SPARC_REGISTER), "DT_STRSZ": reflect.ValueOf(elf.DT_STRSZ), "DT_STRTAB": reflect.ValueOf(elf.DT_STRTAB), "DT_SYMBOLIC": reflect.ValueOf(elf.DT_SYMBOLIC), "DT_SYMENT": reflect.ValueOf(elf.DT_SYMENT), + "DT_SYMINENT": reflect.ValueOf(elf.DT_SYMINENT), + "DT_SYMINFO": reflect.ValueOf(elf.DT_SYMINFO), + "DT_SYMINSZ": reflect.ValueOf(elf.DT_SYMINSZ), "DT_SYMTAB": reflect.ValueOf(elf.DT_SYMTAB), + "DT_SYMTAB_SHNDX": reflect.ValueOf(elf.DT_SYMTAB_SHNDX), "DT_TEXTREL": reflect.ValueOf(elf.DT_TEXTREL), + "DT_TLSDESC_GOT": reflect.ValueOf(elf.DT_TLSDESC_GOT), + "DT_TLSDESC_PLT": reflect.ValueOf(elf.DT_TLSDESC_PLT), + "DT_USED": reflect.ValueOf(elf.DT_USED), + "DT_VALRNGHI": reflect.ValueOf(elf.DT_VALRNGHI), + "DT_VALRNGLO": reflect.ValueOf(elf.DT_VALRNGLO), + "DT_VERDEF": reflect.ValueOf(elf.DT_VERDEF), + "DT_VERDEFNUM": reflect.ValueOf(elf.DT_VERDEFNUM), "DT_VERNEED": reflect.ValueOf(elf.DT_VERNEED), "DT_VERNEEDNUM": reflect.ValueOf(elf.DT_VERNEEDNUM), "DT_VERSYM": reflect.ValueOf(elf.DT_VERSYM), @@ -79,7 +168,7 @@ func init() { "ELFDATA2LSB": reflect.ValueOf(elf.ELFDATA2LSB), "ELFDATA2MSB": reflect.ValueOf(elf.ELFDATA2MSB), "ELFDATANONE": reflect.ValueOf(elf.ELFDATANONE), - "ELFMAG": reflect.ValueOf(constant.MakeFromLiteral("\"\\u007fELF\"", token.STRING, 0)), + "ELFMAG": reflect.ValueOf(constant.MakeFromLiteral("\"\\x7fELF\"", token.STRING, 0)), "ELFOSABI_86OPEN": reflect.ValueOf(elf.ELFOSABI_86OPEN), "ELFOSABI_AIX": reflect.ValueOf(elf.ELFOSABI_AIX), "ELFOSABI_ARM": reflect.ValueOf(elf.ELFOSABI_ARM), @@ -186,6 +275,7 @@ func init() { "EM_L10M": reflect.ValueOf(elf.EM_L10M), "EM_LANAI": reflect.ValueOf(elf.EM_LANAI), "EM_LATTICEMICO32": reflect.ValueOf(elf.EM_LATTICEMICO32), + "EM_LOONGARCH": reflect.ValueOf(elf.EM_LOONGARCH), "EM_M16C": reflect.ValueOf(elf.EM_M16C), "EM_M32": reflect.ValueOf(elf.EM_M32), "EM_M32C": reflect.ValueOf(elf.EM_M32C), @@ -308,17 +398,38 @@ func init() { "PF_R": reflect.ValueOf(elf.PF_R), "PF_W": reflect.ValueOf(elf.PF_W), "PF_X": reflect.ValueOf(elf.PF_X), + "PT_AARCH64_ARCHEXT": reflect.ValueOf(elf.PT_AARCH64_ARCHEXT), + "PT_AARCH64_UNWIND": reflect.ValueOf(elf.PT_AARCH64_UNWIND), + "PT_ARM_ARCHEXT": reflect.ValueOf(elf.PT_ARM_ARCHEXT), + "PT_ARM_EXIDX": reflect.ValueOf(elf.PT_ARM_EXIDX), "PT_DYNAMIC": reflect.ValueOf(elf.PT_DYNAMIC), + "PT_GNU_EH_FRAME": reflect.ValueOf(elf.PT_GNU_EH_FRAME), + "PT_GNU_MBIND_HI": reflect.ValueOf(elf.PT_GNU_MBIND_HI), + "PT_GNU_MBIND_LO": reflect.ValueOf(elf.PT_GNU_MBIND_LO), + "PT_GNU_PROPERTY": reflect.ValueOf(elf.PT_GNU_PROPERTY), + "PT_GNU_RELRO": reflect.ValueOf(elf.PT_GNU_RELRO), + "PT_GNU_STACK": reflect.ValueOf(elf.PT_GNU_STACK), "PT_HIOS": reflect.ValueOf(elf.PT_HIOS), "PT_HIPROC": reflect.ValueOf(elf.PT_HIPROC), "PT_INTERP": reflect.ValueOf(elf.PT_INTERP), "PT_LOAD": reflect.ValueOf(elf.PT_LOAD), "PT_LOOS": reflect.ValueOf(elf.PT_LOOS), "PT_LOPROC": reflect.ValueOf(elf.PT_LOPROC), + "PT_MIPS_ABIFLAGS": reflect.ValueOf(elf.PT_MIPS_ABIFLAGS), + "PT_MIPS_OPTIONS": reflect.ValueOf(elf.PT_MIPS_OPTIONS), + "PT_MIPS_REGINFO": reflect.ValueOf(elf.PT_MIPS_REGINFO), + "PT_MIPS_RTPROC": reflect.ValueOf(elf.PT_MIPS_RTPROC), "PT_NOTE": reflect.ValueOf(elf.PT_NOTE), "PT_NULL": reflect.ValueOf(elf.PT_NULL), + "PT_OPENBSD_BOOTDATA": reflect.ValueOf(elf.PT_OPENBSD_BOOTDATA), + "PT_OPENBSD_RANDOMIZE": reflect.ValueOf(elf.PT_OPENBSD_RANDOMIZE), + "PT_OPENBSD_WXNEEDED": reflect.ValueOf(elf.PT_OPENBSD_WXNEEDED), + "PT_PAX_FLAGS": reflect.ValueOf(elf.PT_PAX_FLAGS), "PT_PHDR": reflect.ValueOf(elf.PT_PHDR), + "PT_S390_PGSTE": reflect.ValueOf(elf.PT_S390_PGSTE), "PT_SHLIB": reflect.ValueOf(elf.PT_SHLIB), + "PT_SUNWSTACK": reflect.ValueOf(elf.PT_SUNWSTACK), + "PT_SUNW_EH_FRAME": reflect.ValueOf(elf.PT_SUNW_EH_FRAME), "PT_TLS": reflect.ValueOf(elf.PT_TLS), "R_386_16": reflect.ValueOf(elf.R_386_16), "R_386_32": reflect.ValueOf(elf.R_386_32), @@ -727,6 +838,56 @@ func init() { "R_ARM_XPC25": reflect.ValueOf(elf.R_ARM_XPC25), "R_INFO": reflect.ValueOf(elf.R_INFO), "R_INFO32": reflect.ValueOf(elf.R_INFO32), + "R_LARCH_32": reflect.ValueOf(elf.R_LARCH_32), + "R_LARCH_64": reflect.ValueOf(elf.R_LARCH_64), + "R_LARCH_ADD16": reflect.ValueOf(elf.R_LARCH_ADD16), + "R_LARCH_ADD24": reflect.ValueOf(elf.R_LARCH_ADD24), + "R_LARCH_ADD32": reflect.ValueOf(elf.R_LARCH_ADD32), + "R_LARCH_ADD64": reflect.ValueOf(elf.R_LARCH_ADD64), + "R_LARCH_ADD8": reflect.ValueOf(elf.R_LARCH_ADD8), + "R_LARCH_COPY": reflect.ValueOf(elf.R_LARCH_COPY), + "R_LARCH_IRELATIVE": reflect.ValueOf(elf.R_LARCH_IRELATIVE), + "R_LARCH_JUMP_SLOT": reflect.ValueOf(elf.R_LARCH_JUMP_SLOT), + "R_LARCH_MARK_LA": reflect.ValueOf(elf.R_LARCH_MARK_LA), + "R_LARCH_MARK_PCREL": reflect.ValueOf(elf.R_LARCH_MARK_PCREL), + "R_LARCH_NONE": reflect.ValueOf(elf.R_LARCH_NONE), + "R_LARCH_RELATIVE": reflect.ValueOf(elf.R_LARCH_RELATIVE), + "R_LARCH_SOP_ADD": reflect.ValueOf(elf.R_LARCH_SOP_ADD), + "R_LARCH_SOP_AND": reflect.ValueOf(elf.R_LARCH_SOP_AND), + "R_LARCH_SOP_ASSERT": reflect.ValueOf(elf.R_LARCH_SOP_ASSERT), + "R_LARCH_SOP_IF_ELSE": reflect.ValueOf(elf.R_LARCH_SOP_IF_ELSE), + "R_LARCH_SOP_NOT": reflect.ValueOf(elf.R_LARCH_SOP_NOT), + "R_LARCH_SOP_POP_32_S_0_10_10_16_S2": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_0_10_10_16_S2), + "R_LARCH_SOP_POP_32_S_0_5_10_16_S2": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_0_5_10_16_S2), + "R_LARCH_SOP_POP_32_S_10_12": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_10_12), + "R_LARCH_SOP_POP_32_S_10_16": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_10_16), + "R_LARCH_SOP_POP_32_S_10_16_S2": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_10_16_S2), + "R_LARCH_SOP_POP_32_S_10_5": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_10_5), + "R_LARCH_SOP_POP_32_S_5_20": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_S_5_20), + "R_LARCH_SOP_POP_32_U": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_U), + "R_LARCH_SOP_POP_32_U_10_12": reflect.ValueOf(elf.R_LARCH_SOP_POP_32_U_10_12), + "R_LARCH_SOP_PUSH_ABSOLUTE": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_ABSOLUTE), + "R_LARCH_SOP_PUSH_DUP": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_DUP), + "R_LARCH_SOP_PUSH_GPREL": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_GPREL), + "R_LARCH_SOP_PUSH_PCREL": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_PCREL), + "R_LARCH_SOP_PUSH_PLT_PCREL": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_PLT_PCREL), + "R_LARCH_SOP_PUSH_TLS_GD": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_TLS_GD), + "R_LARCH_SOP_PUSH_TLS_GOT": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_TLS_GOT), + "R_LARCH_SOP_PUSH_TLS_TPREL": reflect.ValueOf(elf.R_LARCH_SOP_PUSH_TLS_TPREL), + "R_LARCH_SOP_SL": reflect.ValueOf(elf.R_LARCH_SOP_SL), + "R_LARCH_SOP_SR": reflect.ValueOf(elf.R_LARCH_SOP_SR), + "R_LARCH_SOP_SUB": reflect.ValueOf(elf.R_LARCH_SOP_SUB), + "R_LARCH_SUB16": reflect.ValueOf(elf.R_LARCH_SUB16), + "R_LARCH_SUB24": reflect.ValueOf(elf.R_LARCH_SUB24), + "R_LARCH_SUB32": reflect.ValueOf(elf.R_LARCH_SUB32), + "R_LARCH_SUB64": reflect.ValueOf(elf.R_LARCH_SUB64), + "R_LARCH_SUB8": reflect.ValueOf(elf.R_LARCH_SUB8), + "R_LARCH_TLS_DTPMOD32": reflect.ValueOf(elf.R_LARCH_TLS_DTPMOD32), + "R_LARCH_TLS_DTPMOD64": reflect.ValueOf(elf.R_LARCH_TLS_DTPMOD64), + "R_LARCH_TLS_DTPREL32": reflect.ValueOf(elf.R_LARCH_TLS_DTPREL32), + "R_LARCH_TLS_DTPREL64": reflect.ValueOf(elf.R_LARCH_TLS_DTPREL64), + "R_LARCH_TLS_TPREL32": reflect.ValueOf(elf.R_LARCH_TLS_TPREL32), + "R_LARCH_TLS_TPREL64": reflect.ValueOf(elf.R_LARCH_TLS_TPREL64), "R_MIPS_16": reflect.ValueOf(elf.R_MIPS_16), "R_MIPS_26": reflect.ValueOf(elf.R_MIPS_26), "R_MIPS_32": reflect.ValueOf(elf.R_MIPS_32), @@ -854,6 +1015,7 @@ func init() { "R_PPC64_REL24_NOTOC": reflect.ValueOf(elf.R_PPC64_REL24_NOTOC), "R_PPC64_REL32": reflect.ValueOf(elf.R_PPC64_REL32), "R_PPC64_REL64": reflect.ValueOf(elf.R_PPC64_REL64), + "R_PPC64_RELATIVE": reflect.ValueOf(elf.R_PPC64_RELATIVE), "R_PPC64_SECTOFF_DS": reflect.ValueOf(elf.R_PPC64_SECTOFF_DS), "R_PPC64_SECTOFF_LO_DS": reflect.ValueOf(elf.R_PPC64_SECTOFF_LO_DS), "R_PPC64_TLS": reflect.ValueOf(elf.R_PPC64_TLS), @@ -1155,6 +1317,7 @@ func init() { "SHT_LOOS": reflect.ValueOf(elf.SHT_LOOS), "SHT_LOPROC": reflect.ValueOf(elf.SHT_LOPROC), "SHT_LOUSER": reflect.ValueOf(elf.SHT_LOUSER), + "SHT_MIPS_ABIFLAGS": reflect.ValueOf(elf.SHT_MIPS_ABIFLAGS), "SHT_NOBITS": reflect.ValueOf(elf.SHT_NOBITS), "SHT_NOTE": reflect.ValueOf(elf.SHT_NOTE), "SHT_NULL": reflect.ValueOf(elf.SHT_NULL), @@ -1225,6 +1388,7 @@ func init() { "R_AARCH64": reflect.ValueOf((*elf.R_AARCH64)(nil)), "R_ALPHA": reflect.ValueOf((*elf.R_ALPHA)(nil)), "R_ARM": reflect.ValueOf((*elf.R_ARM)(nil)), + "R_LARCH": reflect.ValueOf((*elf.R_LARCH)(nil)), "R_MIPS": reflect.ValueOf((*elf.R_MIPS)(nil)), "R_PPC": reflect.ValueOf((*elf.R_PPC)(nil)), "R_PPC64": reflect.ValueOf((*elf.R_PPC64)(nil)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_gosym.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_gosym.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_gosym.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_gosym.go index a06dfad..ad98573 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_gosym.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_gosym.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/gosym'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/gosym"] = map[string]reflect.Value{ + Symbols["debug/gosym/gosym"] = map[string]reflect.Value{ // function, constant and variable definitions "NewLineTable": reflect.ValueOf(gosym.NewLineTable), "NewTable": reflect.ValueOf(gosym.NewTable), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_macho.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_macho.go similarity index 98% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_macho.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_macho.go index da19d92..f7e0f16 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_debug_macho.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_macho.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/macho'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["debug/macho"] = map[string]reflect.Value{ + Symbols["debug/macho/macho"] = map[string]reflect.Value{ // function, constant and variable definitions "ARM64_RELOC_ADDEND": reflect.ValueOf(macho.ARM64_RELOC_ADDEND), "ARM64_RELOC_BRANCH26": reflect.ValueOf(macho.ARM64_RELOC_BRANCH26), @@ -150,7 +151,10 @@ func init() { // _debug_macho_Load is an interface wrapper for Load type type _debug_macho_Load struct { - WRaw func() []byte + IValue interface{} + WRaw func() []byte } -func (W _debug_macho_Load) Raw() []byte { return W.WRaw() } +func (W _debug_macho_Load) Raw() []byte { + return W.WRaw() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_pe.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_pe.go similarity index 76% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_pe.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_pe.go index 41bc652..3fd21d1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_debug_pe.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_pe.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract debug/pe'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,9 +13,15 @@ import ( ) func init() { - Symbols["debug/pe"] = map[string]reflect.Value{ + Symbols["debug/pe/pe"] = map[string]reflect.Value{ // function, constant and variable definitions "COFFSymbolSize": reflect.ValueOf(constant.MakeFromLiteral("18", token.INT, 0)), + "IMAGE_COMDAT_SELECT_ANY": reflect.ValueOf(constant.MakeFromLiteral("2", token.INT, 0)), + "IMAGE_COMDAT_SELECT_ASSOCIATIVE": reflect.ValueOf(constant.MakeFromLiteral("5", token.INT, 0)), + "IMAGE_COMDAT_SELECT_EXACT_MATCH": reflect.ValueOf(constant.MakeFromLiteral("4", token.INT, 0)), + "IMAGE_COMDAT_SELECT_LARGEST": reflect.ValueOf(constant.MakeFromLiteral("6", token.INT, 0)), + "IMAGE_COMDAT_SELECT_NODUPLICATES": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), + "IMAGE_COMDAT_SELECT_SAME_SIZE": reflect.ValueOf(constant.MakeFromLiteral("3", token.INT, 0)), "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE": reflect.ValueOf(constant.MakeFromLiteral("7", token.INT, 0)), "IMAGE_DIRECTORY_ENTRY_BASERELOC": reflect.ValueOf(constant.MakeFromLiteral("5", token.INT, 0)), "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT": reflect.ValueOf(constant.MakeFromLiteral("11", token.INT, 0)), @@ -59,6 +66,8 @@ func init() { "IMAGE_FILE_MACHINE_EBC": reflect.ValueOf(constant.MakeFromLiteral("3772", token.INT, 0)), "IMAGE_FILE_MACHINE_I386": reflect.ValueOf(constant.MakeFromLiteral("332", token.INT, 0)), "IMAGE_FILE_MACHINE_IA64": reflect.ValueOf(constant.MakeFromLiteral("512", token.INT, 0)), + "IMAGE_FILE_MACHINE_LOONGARCH32": reflect.ValueOf(constant.MakeFromLiteral("25138", token.INT, 0)), + "IMAGE_FILE_MACHINE_LOONGARCH64": reflect.ValueOf(constant.MakeFromLiteral("25188", token.INT, 0)), "IMAGE_FILE_MACHINE_M32R": reflect.ValueOf(constant.MakeFromLiteral("36929", token.INT, 0)), "IMAGE_FILE_MACHINE_MIPS16": reflect.ValueOf(constant.MakeFromLiteral("614", token.INT, 0)), "IMAGE_FILE_MACHINE_MIPSFPU": reflect.ValueOf(constant.MakeFromLiteral("870", token.INT, 0)), @@ -78,6 +87,14 @@ func init() { "IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP": reflect.ValueOf(constant.MakeFromLiteral("1024", token.INT, 0)), "IMAGE_FILE_SYSTEM": reflect.ValueOf(constant.MakeFromLiteral("4096", token.INT, 0)), "IMAGE_FILE_UP_SYSTEM_ONLY": reflect.ValueOf(constant.MakeFromLiteral("16384", token.INT, 0)), + "IMAGE_SCN_CNT_CODE": reflect.ValueOf(constant.MakeFromLiteral("32", token.INT, 0)), + "IMAGE_SCN_CNT_INITIALIZED_DATA": reflect.ValueOf(constant.MakeFromLiteral("64", token.INT, 0)), + "IMAGE_SCN_CNT_UNINITIALIZED_DATA": reflect.ValueOf(constant.MakeFromLiteral("128", token.INT, 0)), + "IMAGE_SCN_LNK_COMDAT": reflect.ValueOf(constant.MakeFromLiteral("4096", token.INT, 0)), + "IMAGE_SCN_MEM_DISCARDABLE": reflect.ValueOf(constant.MakeFromLiteral("33554432", token.INT, 0)), + "IMAGE_SCN_MEM_EXECUTE": reflect.ValueOf(constant.MakeFromLiteral("536870912", token.INT, 0)), + "IMAGE_SCN_MEM_READ": reflect.ValueOf(constant.MakeFromLiteral("1073741824", token.INT, 0)), + "IMAGE_SCN_MEM_WRITE": reflect.ValueOf(constant.MakeFromLiteral("2147483648", token.INT, 0)), "IMAGE_SUBSYSTEM_EFI_APPLICATION": reflect.ValueOf(constant.MakeFromLiteral("10", token.INT, 0)), "IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER": reflect.ValueOf(constant.MakeFromLiteral("11", token.INT, 0)), "IMAGE_SUBSYSTEM_EFI_ROM": reflect.ValueOf(constant.MakeFromLiteral("13", token.INT, 0)), @@ -96,19 +113,20 @@ func init() { "Open": reflect.ValueOf(pe.Open), // type definitions - "COFFSymbol": reflect.ValueOf((*pe.COFFSymbol)(nil)), - "DataDirectory": reflect.ValueOf((*pe.DataDirectory)(nil)), - "File": reflect.ValueOf((*pe.File)(nil)), - "FileHeader": reflect.ValueOf((*pe.FileHeader)(nil)), - "FormatError": reflect.ValueOf((*pe.FormatError)(nil)), - "ImportDirectory": reflect.ValueOf((*pe.ImportDirectory)(nil)), - "OptionalHeader32": reflect.ValueOf((*pe.OptionalHeader32)(nil)), - "OptionalHeader64": reflect.ValueOf((*pe.OptionalHeader64)(nil)), - "Reloc": reflect.ValueOf((*pe.Reloc)(nil)), - "Section": reflect.ValueOf((*pe.Section)(nil)), - "SectionHeader": reflect.ValueOf((*pe.SectionHeader)(nil)), - "SectionHeader32": reflect.ValueOf((*pe.SectionHeader32)(nil)), - "StringTable": reflect.ValueOf((*pe.StringTable)(nil)), - "Symbol": reflect.ValueOf((*pe.Symbol)(nil)), + "COFFSymbol": reflect.ValueOf((*pe.COFFSymbol)(nil)), + "COFFSymbolAuxFormat5": reflect.ValueOf((*pe.COFFSymbolAuxFormat5)(nil)), + "DataDirectory": reflect.ValueOf((*pe.DataDirectory)(nil)), + "File": reflect.ValueOf((*pe.File)(nil)), + "FileHeader": reflect.ValueOf((*pe.FileHeader)(nil)), + "FormatError": reflect.ValueOf((*pe.FormatError)(nil)), + "ImportDirectory": reflect.ValueOf((*pe.ImportDirectory)(nil)), + "OptionalHeader32": reflect.ValueOf((*pe.OptionalHeader32)(nil)), + "OptionalHeader64": reflect.ValueOf((*pe.OptionalHeader64)(nil)), + "Reloc": reflect.ValueOf((*pe.Reloc)(nil)), + "Section": reflect.ValueOf((*pe.Section)(nil)), + "SectionHeader": reflect.ValueOf((*pe.SectionHeader)(nil)), + "SectionHeader32": reflect.ValueOf((*pe.SectionHeader32)(nil)), + "StringTable": reflect.ValueOf((*pe.StringTable)(nil)), + "Symbol": reflect.ValueOf((*pe.Symbol)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_plan9obj.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_plan9obj.go new file mode 100644 index 0000000..ffb1728 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_debug_plan9obj.go @@ -0,0 +1,33 @@ +// Code generated by 'yaegi extract debug/plan9obj'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "debug/plan9obj" + "go/constant" + "go/token" + "reflect" +) + +func init() { + Symbols["debug/plan9obj/plan9obj"] = map[string]reflect.Value{ + // function, constant and variable definitions + "ErrNoSymbols": reflect.ValueOf(&plan9obj.ErrNoSymbols).Elem(), + "Magic386": reflect.ValueOf(constant.MakeFromLiteral("491", token.INT, 0)), + "Magic64": reflect.ValueOf(constant.MakeFromLiteral("32768", token.INT, 0)), + "MagicAMD64": reflect.ValueOf(constant.MakeFromLiteral("35479", token.INT, 0)), + "MagicARM": reflect.ValueOf(constant.MakeFromLiteral("1607", token.INT, 0)), + "NewFile": reflect.ValueOf(plan9obj.NewFile), + "Open": reflect.ValueOf(plan9obj.Open), + + // type definitions + "File": reflect.ValueOf((*plan9obj.File)(nil)), + "FileHeader": reflect.ValueOf((*plan9obj.FileHeader)(nil)), + "Section": reflect.ValueOf((*plan9obj.Section)(nil)), + "SectionHeader": reflect.ValueOf((*plan9obj.SectionHeader)(nil)), + "Sym": reflect.ValueOf((*plan9obj.Sym)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_embed.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_embed.go similarity index 68% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_embed.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_embed.go index 9b6c7dc..5f86263 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_embed.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_embed.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract embed'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["embed"] = map[string]reflect.Value{ + Symbols["embed/embed"] = map[string]reflect.Value{ // type definitions "FS": reflect.ValueOf((*embed.FS)(nil)), } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding.go index 4d95e02..bc4b3f1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding"] = map[string]reflect.Value{ + Symbols["encoding/encoding"] = map[string]reflect.Value{ // type definitions "BinaryMarshaler": reflect.ValueOf((*encoding.BinaryMarshaler)(nil)), "BinaryUnmarshaler": reflect.ValueOf((*encoding.BinaryUnmarshaler)(nil)), @@ -27,6 +28,7 @@ func init() { // _encoding_BinaryMarshaler is an interface wrapper for BinaryMarshaler type type _encoding_BinaryMarshaler struct { + IValue interface{} WMarshalBinary func() (data []byte, err error) } @@ -36,6 +38,7 @@ func (W _encoding_BinaryMarshaler) MarshalBinary() (data []byte, err error) { // _encoding_BinaryUnmarshaler is an interface wrapper for BinaryUnmarshaler type type _encoding_BinaryUnmarshaler struct { + IValue interface{} WUnmarshalBinary func(data []byte) error } @@ -45,14 +48,20 @@ func (W _encoding_BinaryUnmarshaler) UnmarshalBinary(data []byte) error { // _encoding_TextMarshaler is an interface wrapper for TextMarshaler type type _encoding_TextMarshaler struct { + IValue interface{} WMarshalText func() (text []byte, err error) } -func (W _encoding_TextMarshaler) MarshalText() (text []byte, err error) { return W.WMarshalText() } +func (W _encoding_TextMarshaler) MarshalText() (text []byte, err error) { + return W.WMarshalText() +} // _encoding_TextUnmarshaler is an interface wrapper for TextUnmarshaler type type _encoding_TextUnmarshaler struct { + IValue interface{} WUnmarshalText func(text []byte) error } -func (W _encoding_TextUnmarshaler) UnmarshalText(text []byte) error { return W.WUnmarshalText(text) } +func (W _encoding_TextUnmarshaler) UnmarshalText(text []byte) error { + return W.WUnmarshalText(text) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_ascii85.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_ascii85.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_ascii85.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_ascii85.go index 9886d76..ea29fd2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_ascii85.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_ascii85.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/ascii85'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/ascii85"] = map[string]reflect.Value{ + Symbols["encoding/ascii85/ascii85"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(ascii85.Decode), "Encode": reflect.ValueOf(ascii85.Encode), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_asn1.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_asn1.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_asn1.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_asn1.go index ad4477c..d1a943c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_asn1.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_asn1.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/asn1'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["encoding/asn1"] = map[string]reflect.Value{ + Symbols["encoding/asn1/asn1"] = map[string]reflect.Value{ // function, constant and variable definitions "ClassApplication": reflect.ValueOf(constant.MakeFromLiteral("1", token.INT, 0)), "ClassContextSpecific": reflect.ValueOf(constant.MakeFromLiteral("2", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base32.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base32.go index 410df14..10184ba 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/base32'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/base32"] = map[string]reflect.Value{ + Symbols["encoding/base32/base32"] = map[string]reflect.Value{ // function, constant and variable definitions "HexEncoding": reflect.ValueOf(&base32.HexEncoding).Elem(), "NewDecoder": reflect.ValueOf(base32.NewDecoder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base64.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base64.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base64.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base64.go index a741ca2..37c5ef9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_base64.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_base64.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/base64'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/base64"] = map[string]reflect.Value{ + Symbols["encoding/base64/base64"] = map[string]reflect.Value{ // function, constant and variable definitions "NewDecoder": reflect.ValueOf(base64.NewDecoder), "NewEncoder": reflect.ValueOf(base64.NewEncoder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_binary.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_binary.go new file mode 100644 index 0000000..712c047 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_binary.go @@ -0,0 +1,105 @@ +// Code generated by 'yaegi extract encoding/binary'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "encoding/binary" + "go/constant" + "go/token" + "reflect" +) + +func init() { + Symbols["encoding/binary/binary"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AppendUvarint": reflect.ValueOf(binary.AppendUvarint), + "AppendVarint": reflect.ValueOf(binary.AppendVarint), + "BigEndian": reflect.ValueOf(&binary.BigEndian).Elem(), + "LittleEndian": reflect.ValueOf(&binary.LittleEndian).Elem(), + "MaxVarintLen16": reflect.ValueOf(constant.MakeFromLiteral("3", token.INT, 0)), + "MaxVarintLen32": reflect.ValueOf(constant.MakeFromLiteral("5", token.INT, 0)), + "MaxVarintLen64": reflect.ValueOf(constant.MakeFromLiteral("10", token.INT, 0)), + "PutUvarint": reflect.ValueOf(binary.PutUvarint), + "PutVarint": reflect.ValueOf(binary.PutVarint), + "Read": reflect.ValueOf(binary.Read), + "ReadUvarint": reflect.ValueOf(binary.ReadUvarint), + "ReadVarint": reflect.ValueOf(binary.ReadVarint), + "Size": reflect.ValueOf(binary.Size), + "Uvarint": reflect.ValueOf(binary.Uvarint), + "Varint": reflect.ValueOf(binary.Varint), + "Write": reflect.ValueOf(binary.Write), + + // type definitions + "AppendByteOrder": reflect.ValueOf((*binary.AppendByteOrder)(nil)), + "ByteOrder": reflect.ValueOf((*binary.ByteOrder)(nil)), + + // interface wrapper definitions + "_AppendByteOrder": reflect.ValueOf((*_encoding_binary_AppendByteOrder)(nil)), + "_ByteOrder": reflect.ValueOf((*_encoding_binary_ByteOrder)(nil)), + } +} + +// _encoding_binary_AppendByteOrder is an interface wrapper for AppendByteOrder type +type _encoding_binary_AppendByteOrder struct { + IValue interface{} + WAppendUint16 func(a0 []byte, a1 uint16) []byte + WAppendUint32 func(a0 []byte, a1 uint32) []byte + WAppendUint64 func(a0 []byte, a1 uint64) []byte + WString func() string +} + +func (W _encoding_binary_AppendByteOrder) AppendUint16(a0 []byte, a1 uint16) []byte { + return W.WAppendUint16(a0, a1) +} +func (W _encoding_binary_AppendByteOrder) AppendUint32(a0 []byte, a1 uint32) []byte { + return W.WAppendUint32(a0, a1) +} +func (W _encoding_binary_AppendByteOrder) AppendUint64(a0 []byte, a1 uint64) []byte { + return W.WAppendUint64(a0, a1) +} +func (W _encoding_binary_AppendByteOrder) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} + +// _encoding_binary_ByteOrder is an interface wrapper for ByteOrder type +type _encoding_binary_ByteOrder struct { + IValue interface{} + WPutUint16 func(a0 []byte, a1 uint16) + WPutUint32 func(a0 []byte, a1 uint32) + WPutUint64 func(a0 []byte, a1 uint64) + WString func() string + WUint16 func(a0 []byte) uint16 + WUint32 func(a0 []byte) uint32 + WUint64 func(a0 []byte) uint64 +} + +func (W _encoding_binary_ByteOrder) PutUint16(a0 []byte, a1 uint16) { + W.WPutUint16(a0, a1) +} +func (W _encoding_binary_ByteOrder) PutUint32(a0 []byte, a1 uint32) { + W.WPutUint32(a0, a1) +} +func (W _encoding_binary_ByteOrder) PutUint64(a0 []byte, a1 uint64) { + W.WPutUint64(a0, a1) +} +func (W _encoding_binary_ByteOrder) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _encoding_binary_ByteOrder) Uint16(a0 []byte) uint16 { + return W.WUint16(a0) +} +func (W _encoding_binary_ByteOrder) Uint32(a0 []byte) uint32 { + return W.WUint32(a0) +} +func (W _encoding_binary_ByteOrder) Uint64(a0 []byte) uint64 { + return W.WUint64(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_csv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_csv.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_csv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_csv.go index b4fe1e2..78da39b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_csv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_csv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/csv'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/csv"] = map[string]reflect.Value{ + Symbols["encoding/csv/csv"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrBareQuote": reflect.ValueOf(&csv.ErrBareQuote).Elem(), "ErrFieldCount": reflect.ValueOf(&csv.ErrFieldCount).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_gob.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_gob.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_gob.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_gob.go index 41a37bd..a4f120a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_gob.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_gob.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/gob'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/gob"] = map[string]reflect.Value{ + Symbols["encoding/gob/gob"] = map[string]reflect.Value{ // function, constant and variable definitions "NewDecoder": reflect.ValueOf(gob.NewDecoder), "NewEncoder": reflect.ValueOf(gob.NewEncoder), @@ -32,14 +33,20 @@ func init() { // _encoding_gob_GobDecoder is an interface wrapper for GobDecoder type type _encoding_gob_GobDecoder struct { + IValue interface{} WGobDecode func(a0 []byte) error } -func (W _encoding_gob_GobDecoder) GobDecode(a0 []byte) error { return W.WGobDecode(a0) } +func (W _encoding_gob_GobDecoder) GobDecode(a0 []byte) error { + return W.WGobDecode(a0) +} // _encoding_gob_GobEncoder is an interface wrapper for GobEncoder type type _encoding_gob_GobEncoder struct { + IValue interface{} WGobEncode func() ([]byte, error) } -func (W _encoding_gob_GobEncoder) GobEncode() ([]byte, error) { return W.WGobEncode() } +func (W _encoding_gob_GobEncoder) GobEncode() ([]byte, error) { + return W.WGobEncode() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_hex.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_hex.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_hex.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_hex.go index f15310d..4de0b6b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_hex.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_hex.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/hex'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/hex"] = map[string]reflect.Value{ + Symbols["encoding/hex/hex"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(hex.Decode), "DecodeString": reflect.ValueOf(hex.DecodeString), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_json.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_json.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_json.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_json.go index c1fdd9f..7264248 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_json.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_json.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/json'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/json"] = map[string]reflect.Value{ + Symbols["encoding/json/json"] = map[string]reflect.Value{ // function, constant and variable definitions "Compact": reflect.ValueOf(json.Compact), "HTMLEscape": reflect.ValueOf(json.HTMLEscape), @@ -49,18 +50,25 @@ func init() { // _encoding_json_Marshaler is an interface wrapper for Marshaler type type _encoding_json_Marshaler struct { + IValue interface{} WMarshalJSON func() ([]byte, error) } -func (W _encoding_json_Marshaler) MarshalJSON() ([]byte, error) { return W.WMarshalJSON() } +func (W _encoding_json_Marshaler) MarshalJSON() ([]byte, error) { + return W.WMarshalJSON() +} // _encoding_json_Token is an interface wrapper for Token type type _encoding_json_Token struct { + IValue interface{} } // _encoding_json_Unmarshaler is an interface wrapper for Unmarshaler type type _encoding_json_Unmarshaler struct { + IValue interface{} WUnmarshalJSON func(a0 []byte) error } -func (W _encoding_json_Unmarshaler) UnmarshalJSON(a0 []byte) error { return W.WUnmarshalJSON(a0) } +func (W _encoding_json_Unmarshaler) UnmarshalJSON(a0 []byte) error { + return W.WUnmarshalJSON(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_pem.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_pem.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_pem.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_pem.go index e5521f7..b00acbe 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_encoding_pem.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_pem.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/pem'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["encoding/pem"] = map[string]reflect.Value{ + Symbols["encoding/pem/pem"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(pem.Decode), "Encode": reflect.ValueOf(pem.Encode), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_xml.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_xml.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_xml.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_xml.go index 96bef1f..9f0ab0e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_encoding_xml.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_encoding_xml.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract encoding/xml'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["encoding/xml"] = map[string]reflect.Value{ + Symbols["encoding/xml/xml"] = map[string]reflect.Value{ // function, constant and variable definitions "CopyToken": reflect.ValueOf(xml.CopyToken), "Escape": reflect.ValueOf(xml.Escape), @@ -61,6 +62,7 @@ func init() { // _encoding_xml_Marshaler is an interface wrapper for Marshaler type type _encoding_xml_Marshaler struct { + IValue interface{} WMarshalXML func(e *xml.Encoder, start xml.StartElement) error } @@ -70,6 +72,7 @@ func (W _encoding_xml_Marshaler) MarshalXML(e *xml.Encoder, start xml.StartEleme // _encoding_xml_MarshalerAttr is an interface wrapper for MarshalerAttr type type _encoding_xml_MarshalerAttr struct { + IValue interface{} WMarshalXMLAttr func(name xml.Name) (xml.Attr, error) } @@ -79,17 +82,22 @@ func (W _encoding_xml_MarshalerAttr) MarshalXMLAttr(name xml.Name) (xml.Attr, er // _encoding_xml_Token is an interface wrapper for Token type type _encoding_xml_Token struct { + IValue interface{} } // _encoding_xml_TokenReader is an interface wrapper for TokenReader type type _encoding_xml_TokenReader struct { + IValue interface{} WToken func() (xml.Token, error) } -func (W _encoding_xml_TokenReader) Token() (xml.Token, error) { return W.WToken() } +func (W _encoding_xml_TokenReader) Token() (xml.Token, error) { + return W.WToken() +} // _encoding_xml_Unmarshaler is an interface wrapper for Unmarshaler type type _encoding_xml_Unmarshaler struct { + IValue interface{} WUnmarshalXML func(d *xml.Decoder, start xml.StartElement) error } @@ -99,6 +107,7 @@ func (W _encoding_xml_Unmarshaler) UnmarshalXML(d *xml.Decoder, start xml.StartE // _encoding_xml_UnmarshalerAttr is an interface wrapper for UnmarshalerAttr type type _encoding_xml_UnmarshalerAttr struct { + IValue interface{} WUnmarshalXMLAttr func(attr xml.Attr) error } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_errors.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_errors.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_errors.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_errors.go index 31651f6..8c68bc2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_errors.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_errors.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract errors'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["errors"] = map[string]reflect.Value{ + Symbols["errors/errors"] = map[string]reflect.Value{ // function, constant and variable definitions "As": reflect.ValueOf(errors.As), "Is": reflect.ValueOf(errors.Is), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_expvar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_expvar.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_expvar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_expvar.go index 6cad346..2e39249 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_expvar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_expvar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract expvar'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["expvar"] = map[string]reflect.Value{ + Symbols["expvar/expvar"] = map[string]reflect.Value{ // function, constant and variable definitions "Do": reflect.ValueOf(expvar.Do), "Get": reflect.ValueOf(expvar.Get), @@ -37,7 +38,13 @@ func init() { // _expvar_Var is an interface wrapper for Var type type _expvar_Var struct { + IValue interface{} WString func() string } -func (W _expvar_Var) String() string { return W.WString() } +func (W _expvar_Var) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_flag.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_flag.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_flag.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_flag.go index e259dd3..8633a62 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_flag.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_flag.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract flag'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["flag"] = map[string]reflect.Value{ + Symbols["flag/flag"] = map[string]reflect.Value{ // function, constant and variable definitions "Arg": reflect.ValueOf(flag.Arg), "Args": reflect.ValueOf(flag.Args), @@ -24,6 +25,7 @@ func init() { "ExitOnError": reflect.ValueOf(flag.ExitOnError), "Float64": reflect.ValueOf(flag.Float64), "Float64Var": reflect.ValueOf(flag.Float64Var), + "Func": reflect.ValueOf(flag.Func), "Int": reflect.ValueOf(flag.Int), "Int64": reflect.ValueOf(flag.Int64), "Int64Var": reflect.ValueOf(flag.Int64Var), @@ -39,6 +41,7 @@ func init() { "Set": reflect.ValueOf(flag.Set), "String": reflect.ValueOf(flag.String), "StringVar": reflect.ValueOf(flag.StringVar), + "TextVar": reflect.ValueOf(flag.TextVar), "Uint": reflect.ValueOf(flag.Uint), "Uint64": reflect.ValueOf(flag.Uint64), "Uint64Var": reflect.ValueOf(flag.Uint64Var), @@ -64,20 +67,38 @@ func init() { // _flag_Getter is an interface wrapper for Getter type type _flag_Getter struct { - WGet func() interface{} + IValue interface{} + WGet func() any WSet func(a0 string) error WString func() string } -func (W _flag_Getter) Get() interface{} { return W.WGet() } -func (W _flag_Getter) Set(a0 string) error { return W.WSet(a0) } -func (W _flag_Getter) String() string { return W.WString() } +func (W _flag_Getter) Get() any { + return W.WGet() +} +func (W _flag_Getter) Set(a0 string) error { + return W.WSet(a0) +} +func (W _flag_Getter) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} // _flag_Value is an interface wrapper for Value type type _flag_Value struct { + IValue interface{} WSet func(a0 string) error WString func() string } -func (W _flag_Value) Set(a0 string) error { return W.WSet(a0) } -func (W _flag_Value) String() string { return W.WString() } +func (W _flag_Value) Set(a0 string) error { + return W.WSet(a0) +} +func (W _flag_Value) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_fmt.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_fmt.go similarity index 69% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_fmt.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_fmt.go index fdd172f..cd58f14 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_fmt.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_fmt.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract fmt'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,8 +11,11 @@ import ( ) func init() { - Symbols["fmt"] = map[string]reflect.Value{ + Symbols["fmt/fmt"] = map[string]reflect.Value{ // function, constant and variable definitions + "Append": reflect.ValueOf(fmt.Append), + "Appendf": reflect.ValueOf(fmt.Appendf), + "Appendln": reflect.ValueOf(fmt.Appendln), "Errorf": reflect.ValueOf(fmt.Errorf), "Fprint": reflect.ValueOf(fmt.Fprint), "Fprintf": reflect.ValueOf(fmt.Fprintf), @@ -52,20 +56,27 @@ func init() { // _fmt_Formatter is an interface wrapper for Formatter type type _fmt_Formatter struct { - WFormat func(f fmt.State, c rune) + IValue interface{} + WFormat func(f fmt.State, verb rune) } -func (W _fmt_Formatter) Format(f fmt.State, c rune) { W.WFormat(f, c) } +func (W _fmt_Formatter) Format(f fmt.State, verb rune) { + W.WFormat(f, verb) +} // _fmt_GoStringer is an interface wrapper for GoStringer type type _fmt_GoStringer struct { + IValue interface{} WGoString func() string } -func (W _fmt_GoStringer) GoString() string { return W.WGoString() } +func (W _fmt_GoStringer) GoString() string { + return W.WGoString() +} // _fmt_ScanState is an interface wrapper for ScanState type type _fmt_ScanState struct { + IValue interface{} WRead func(buf []byte) (n int, err error) WReadRune func() (r rune, size int, err error) WSkipSpace func() @@ -74,38 +85,66 @@ type _fmt_ScanState struct { WWidth func() (wid int, ok bool) } -func (W _fmt_ScanState) Read(buf []byte) (n int, err error) { return W.WRead(buf) } -func (W _fmt_ScanState) ReadRune() (r rune, size int, err error) { return W.WReadRune() } -func (W _fmt_ScanState) SkipSpace() { W.WSkipSpace() } +func (W _fmt_ScanState) Read(buf []byte) (n int, err error) { + return W.WRead(buf) +} +func (W _fmt_ScanState) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} +func (W _fmt_ScanState) SkipSpace() { + W.WSkipSpace() +} func (W _fmt_ScanState) Token(skipSpace bool, f func(rune) bool) (token []byte, err error) { return W.WToken(skipSpace, f) } -func (W _fmt_ScanState) UnreadRune() error { return W.WUnreadRune() } -func (W _fmt_ScanState) Width() (wid int, ok bool) { return W.WWidth() } +func (W _fmt_ScanState) UnreadRune() error { + return W.WUnreadRune() +} +func (W _fmt_ScanState) Width() (wid int, ok bool) { + return W.WWidth() +} // _fmt_Scanner is an interface wrapper for Scanner type type _fmt_Scanner struct { - WScan func(state fmt.ScanState, verb rune) error + IValue interface{} + WScan func(state fmt.ScanState, verb rune) error } -func (W _fmt_Scanner) Scan(state fmt.ScanState, verb rune) error { return W.WScan(state, verb) } +func (W _fmt_Scanner) Scan(state fmt.ScanState, verb rune) error { + return W.WScan(state, verb) +} // _fmt_State is an interface wrapper for State type type _fmt_State struct { + IValue interface{} WFlag func(c int) bool WPrecision func() (prec int, ok bool) WWidth func() (wid int, ok bool) WWrite func(b []byte) (n int, err error) } -func (W _fmt_State) Flag(c int) bool { return W.WFlag(c) } -func (W _fmt_State) Precision() (prec int, ok bool) { return W.WPrecision() } -func (W _fmt_State) Width() (wid int, ok bool) { return W.WWidth() } -func (W _fmt_State) Write(b []byte) (n int, err error) { return W.WWrite(b) } +func (W _fmt_State) Flag(c int) bool { + return W.WFlag(c) +} +func (W _fmt_State) Precision() (prec int, ok bool) { + return W.WPrecision() +} +func (W _fmt_State) Width() (wid int, ok bool) { + return W.WWidth() +} +func (W _fmt_State) Write(b []byte) (n int, err error) { + return W.WWrite(b) +} // _fmt_Stringer is an interface wrapper for Stringer type type _fmt_Stringer struct { + IValue interface{} WString func() string } -func (W _fmt_Stringer) String() string { return W.WString() } +func (W _fmt_Stringer) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_ast.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_ast.go similarity index 85% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_ast.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_ast.go index 96f66c9..0e7b4c4 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_ast.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_ast.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/ast'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/ast"] = map[string]reflect.Value{ + Symbols["go/ast/ast"] = map[string]reflect.Value{ // function, constant and variable definitions "Bad": reflect.ValueOf(ast.Bad), "Con": reflect.ValueOf(ast.Con), @@ -87,6 +88,7 @@ func init() { "Importer": reflect.ValueOf((*ast.Importer)(nil)), "IncDecStmt": reflect.ValueOf((*ast.IncDecStmt)(nil)), "IndexExpr": reflect.ValueOf((*ast.IndexExpr)(nil)), + "IndexListExpr": reflect.ValueOf((*ast.IndexListExpr)(nil)), "InterfaceType": reflect.ValueOf((*ast.InterfaceType)(nil)), "KeyValueExpr": reflect.ValueOf((*ast.KeyValueExpr)(nil)), "LabeledStmt": reflect.ValueOf((*ast.LabeledStmt)(nil)), @@ -128,52 +130,80 @@ func init() { // _go_ast_Decl is an interface wrapper for Decl type type _go_ast_Decl struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Decl) End() token.Pos { return W.WEnd() } -func (W _go_ast_Decl) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Decl) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Decl) Pos() token.Pos { + return W.WPos() +} // _go_ast_Expr is an interface wrapper for Expr type type _go_ast_Expr struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Expr) End() token.Pos { return W.WEnd() } -func (W _go_ast_Expr) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Expr) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Expr) Pos() token.Pos { + return W.WPos() +} // _go_ast_Node is an interface wrapper for Node type type _go_ast_Node struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Node) End() token.Pos { return W.WEnd() } -func (W _go_ast_Node) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Node) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Node) Pos() token.Pos { + return W.WPos() +} // _go_ast_Spec is an interface wrapper for Spec type type _go_ast_Spec struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Spec) End() token.Pos { return W.WEnd() } -func (W _go_ast_Spec) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Spec) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Spec) Pos() token.Pos { + return W.WPos() +} // _go_ast_Stmt is an interface wrapper for Stmt type type _go_ast_Stmt struct { - WEnd func() token.Pos - WPos func() token.Pos + IValue interface{} + WEnd func() token.Pos + WPos func() token.Pos } -func (W _go_ast_Stmt) End() token.Pos { return W.WEnd() } -func (W _go_ast_Stmt) Pos() token.Pos { return W.WPos() } +func (W _go_ast_Stmt) End() token.Pos { + return W.WEnd() +} +func (W _go_ast_Stmt) Pos() token.Pos { + return W.WPos() +} // _go_ast_Visitor is an interface wrapper for Visitor type type _go_ast_Visitor struct { + IValue interface{} WVisit func(node ast.Node) (w ast.Visitor) } -func (W _go_ast_Visitor) Visit(node ast.Node) (w ast.Visitor) { return W.WVisit(node) } +func (W _go_ast_Visitor) Visit(node ast.Node) (w ast.Visitor) { + return W.WVisit(node) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_build.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_build.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build.go index 4a9d433..7b35cb8 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_build.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/build'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/build"] = map[string]reflect.Value{ + Symbols["go/build/build"] = map[string]reflect.Value{ // function, constant and variable definitions "AllowBinary": reflect.ValueOf(build.AllowBinary), "ArchChar": reflect.ValueOf(build.ArchChar), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build_constraint.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build_constraint.go new file mode 100644 index 0000000..f55190e --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_build_constraint.go @@ -0,0 +1,49 @@ +// Code generated by 'yaegi extract go/build/constraint'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "go/build/constraint" + "reflect" +) + +func init() { + Symbols["go/build/constraint/constraint"] = map[string]reflect.Value{ + // function, constant and variable definitions + "IsGoBuild": reflect.ValueOf(constraint.IsGoBuild), + "IsPlusBuild": reflect.ValueOf(constraint.IsPlusBuild), + "Parse": reflect.ValueOf(constraint.Parse), + "PlusBuildLines": reflect.ValueOf(constraint.PlusBuildLines), + + // type definitions + "AndExpr": reflect.ValueOf((*constraint.AndExpr)(nil)), + "Expr": reflect.ValueOf((*constraint.Expr)(nil)), + "NotExpr": reflect.ValueOf((*constraint.NotExpr)(nil)), + "OrExpr": reflect.ValueOf((*constraint.OrExpr)(nil)), + "SyntaxError": reflect.ValueOf((*constraint.SyntaxError)(nil)), + "TagExpr": reflect.ValueOf((*constraint.TagExpr)(nil)), + + // interface wrapper definitions + "_Expr": reflect.ValueOf((*_go_build_constraint_Expr)(nil)), + } +} + +// _go_build_constraint_Expr is an interface wrapper for Expr type +type _go_build_constraint_Expr struct { + IValue interface{} + WEval func(ok func(tag string) bool) bool + WString func() string +} + +func (W _go_build_constraint_Expr) Eval(ok func(tag string) bool) bool { + return W.WEval(ok) +} +func (W _go_build_constraint_Expr) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_constant.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_constant.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_constant.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_constant.go index 93f77a3..d47752c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_constant.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_constant.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/constant'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/constant"] = map[string]reflect.Value{ + Symbols["go/constant/constant"] = map[string]reflect.Value{ // function, constant and variable definitions "BinaryOp": reflect.ValueOf(constant.BinaryOp), "BitLen": reflect.ValueOf(constant.BitLen), @@ -61,11 +62,21 @@ func init() { // _go_constant_Value is an interface wrapper for Value type type _go_constant_Value struct { + IValue interface{} WExactString func() string WKind func() constant.Kind WString func() string } -func (W _go_constant_Value) ExactString() string { return W.WExactString() } -func (W _go_constant_Value) Kind() constant.Kind { return W.WKind() } -func (W _go_constant_Value) String() string { return W.WString() } +func (W _go_constant_Value) ExactString() string { + return W.WExactString() +} +func (W _go_constant_Value) Kind() constant.Kind { + return W.WKind() +} +func (W _go_constant_Value) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_doc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_doc.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_doc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_doc.go index 83ca5b4..1fbb034 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_doc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_doc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/doc'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/doc"] = map[string]reflect.Value{ + Symbols["go/doc/doc"] = map[string]reflect.Value{ // function, constant and variable definitions "AllDecls": reflect.ValueOf(doc.AllDecls), "AllMethods": reflect.ValueOf(doc.AllMethods), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_format.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_format.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_format.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_format.go index f9310cb..aa9d67a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_format.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_format.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/format'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/format"] = map[string]reflect.Value{ + Symbols["go/format/format"] = map[string]reflect.Value{ // function, constant and variable definitions "Node": reflect.ValueOf(format.Node), "Source": reflect.ValueOf(format.Source), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_importer.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_importer.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_importer.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_importer.go index d3bedcd..b64c01a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_importer.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_importer.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/importer'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/importer"] = map[string]reflect.Value{ + Symbols["go/importer/importer"] = map[string]reflect.Value{ // function, constant and variable definitions "Default": reflect.ValueOf(importer.Default), "For": reflect.ValueOf(importer.For), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_parser.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_parser.go new file mode 100644 index 0000000..4aef2e2 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_parser.go @@ -0,0 +1,32 @@ +// Code generated by 'yaegi extract go/parser'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "go/parser" + "reflect" +) + +func init() { + Symbols["go/parser/parser"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AllErrors": reflect.ValueOf(parser.AllErrors), + "DeclarationErrors": reflect.ValueOf(parser.DeclarationErrors), + "ImportsOnly": reflect.ValueOf(parser.ImportsOnly), + "PackageClauseOnly": reflect.ValueOf(parser.PackageClauseOnly), + "ParseComments": reflect.ValueOf(parser.ParseComments), + "ParseDir": reflect.ValueOf(parser.ParseDir), + "ParseExpr": reflect.ValueOf(parser.ParseExpr), + "ParseExprFrom": reflect.ValueOf(parser.ParseExprFrom), + "ParseFile": reflect.ValueOf(parser.ParseFile), + "SkipObjectResolution": reflect.ValueOf(parser.SkipObjectResolution), + "SpuriousErrors": reflect.ValueOf(parser.SpuriousErrors), + "Trace": reflect.ValueOf(parser.Trace), + + // type definitions + "Mode": reflect.ValueOf((*parser.Mode)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_printer.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_printer.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_printer.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_printer.go index 59df347..0876e13 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_printer.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_printer.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/printer'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/printer"] = map[string]reflect.Value{ + Symbols["go/printer/printer"] = map[string]reflect.Value{ // function, constant and variable definitions "Fprint": reflect.ValueOf(printer.Fprint), "RawFormat": reflect.ValueOf(printer.RawFormat), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_scanner.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_scanner.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_go_scanner.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_scanner.go index a7fa186..467dbd6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_go_scanner.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_scanner.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/scanner'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["go/scanner"] = map[string]reflect.Value{ + Symbols["go/scanner/scanner"] = map[string]reflect.Value{ // function, constant and variable definitions "PrintError": reflect.ValueOf(scanner.PrintError), "ScanComments": reflect.ValueOf(scanner.ScanComments), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_token.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_token.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_token.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_token.go index af1b741..2a721f6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_token.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_token.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/token'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/token"] = map[string]reflect.Value{ + Symbols["go/token/token"] = map[string]reflect.Value{ // function, constant and variable definitions "ADD": reflect.ValueOf(token.ADD), "ADD_ASSIGN": reflect.ValueOf(token.ADD_ASSIGN), @@ -98,6 +99,7 @@ func init() { "SUB": reflect.ValueOf(token.SUB), "SUB_ASSIGN": reflect.ValueOf(token.SUB_ASSIGN), "SWITCH": reflect.ValueOf(token.SWITCH), + "TILDE": reflect.ValueOf(token.TILDE), "TYPE": reflect.ValueOf(token.TYPE), "UnaryPrec": reflect.ValueOf(constant.MakeFromLiteral("6", token.INT, 0)), "VAR": reflect.ValueOf(token.VAR), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_types.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_types.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_go_types.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_go_types.go index 173566e..c05d563 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_go_types.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_go_types.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract go/types'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["go/types"] = map[string]reflect.Value{ + Symbols["go/types/types"] = map[string]reflect.Value{ // function, constant and variable definitions "AssertableTo": reflect.ValueOf(types.AssertableTo), "AssignableTo": reflect.ValueOf(types.AssignableTo), @@ -33,6 +34,7 @@ func init() { "Identical": reflect.ValueOf(types.Identical), "IdenticalIgnoreTags": reflect.ValueOf(types.IdenticalIgnoreTags), "Implements": reflect.ValueOf(types.Implements), + "Instantiate": reflect.ValueOf(types.Instantiate), "Int": reflect.ValueOf(types.Int), "Int16": reflect.ValueOf(types.Int16), "Int32": reflect.ValueOf(types.Int32), @@ -58,6 +60,7 @@ func init() { "NewChan": reflect.ValueOf(types.NewChan), "NewChecker": reflect.ValueOf(types.NewChecker), "NewConst": reflect.ValueOf(types.NewConst), + "NewContext": reflect.ValueOf(types.NewContext), "NewField": reflect.ValueOf(types.NewField), "NewFunc": reflect.ValueOf(types.NewFunc), "NewInterface": reflect.ValueOf(types.NewInterface), @@ -72,10 +75,14 @@ func init() { "NewPointer": reflect.ValueOf(types.NewPointer), "NewScope": reflect.ValueOf(types.NewScope), "NewSignature": reflect.ValueOf(types.NewSignature), + "NewSignatureType": reflect.ValueOf(types.NewSignatureType), "NewSlice": reflect.ValueOf(types.NewSlice), "NewStruct": reflect.ValueOf(types.NewStruct), + "NewTerm": reflect.ValueOf(types.NewTerm), "NewTuple": reflect.ValueOf(types.NewTuple), "NewTypeName": reflect.ValueOf(types.NewTypeName), + "NewTypeParam": reflect.ValueOf(types.NewTypeParam), + "NewUnion": reflect.ValueOf(types.NewUnion), "NewVar": reflect.ValueOf(types.NewVar), "ObjectString": reflect.ValueOf(types.ObjectString), "RecvOnly": reflect.ValueOf(types.RecvOnly), @@ -109,6 +116,7 @@ func init() { "WriteType": reflect.ValueOf(types.WriteType), // type definitions + "ArgumentError": reflect.ValueOf((*types.ArgumentError)(nil)), "Array": reflect.ValueOf((*types.Array)(nil)), "Basic": reflect.ValueOf((*types.Basic)(nil)), "BasicInfo": reflect.ValueOf((*types.BasicInfo)(nil)), @@ -119,6 +127,7 @@ func init() { "Checker": reflect.ValueOf((*types.Checker)(nil)), "Config": reflect.ValueOf((*types.Config)(nil)), "Const": reflect.ValueOf((*types.Const)(nil)), + "Context": reflect.ValueOf((*types.Context)(nil)), "Error": reflect.ValueOf((*types.Error)(nil)), "Func": reflect.ValueOf((*types.Func)(nil)), "ImportMode": reflect.ValueOf((*types.ImportMode)(nil)), @@ -126,6 +135,7 @@ func init() { "ImporterFrom": reflect.ValueOf((*types.ImporterFrom)(nil)), "Info": reflect.ValueOf((*types.Info)(nil)), "Initializer": reflect.ValueOf((*types.Initializer)(nil)), + "Instance": reflect.ValueOf((*types.Instance)(nil)), "Interface": reflect.ValueOf((*types.Interface)(nil)), "Label": reflect.ValueOf((*types.Label)(nil)), "Map": reflect.ValueOf((*types.Map)(nil)), @@ -145,10 +155,15 @@ func init() { "Slice": reflect.ValueOf((*types.Slice)(nil)), "StdSizes": reflect.ValueOf((*types.StdSizes)(nil)), "Struct": reflect.ValueOf((*types.Struct)(nil)), + "Term": reflect.ValueOf((*types.Term)(nil)), "Tuple": reflect.ValueOf((*types.Tuple)(nil)), "Type": reflect.ValueOf((*types.Type)(nil)), "TypeAndValue": reflect.ValueOf((*types.TypeAndValue)(nil)), + "TypeList": reflect.ValueOf((*types.TypeList)(nil)), "TypeName": reflect.ValueOf((*types.TypeName)(nil)), + "TypeParam": reflect.ValueOf((*types.TypeParam)(nil)), + "TypeParamList": reflect.ValueOf((*types.TypeParamList)(nil)), + "Union": reflect.ValueOf((*types.Union)(nil)), "Var": reflect.ValueOf((*types.Var)(nil)), // interface wrapper definitions @@ -162,24 +177,31 @@ func init() { // _go_types_Importer is an interface wrapper for Importer type type _go_types_Importer struct { + IValue interface{} WImport func(path string) (*types.Package, error) } -func (W _go_types_Importer) Import(path string) (*types.Package, error) { return W.WImport(path) } +func (W _go_types_Importer) Import(path string) (*types.Package, error) { + return W.WImport(path) +} // _go_types_ImporterFrom is an interface wrapper for ImporterFrom type type _go_types_ImporterFrom struct { + IValue interface{} WImport func(path string) (*types.Package, error) WImportFrom func(path string, dir string, mode types.ImportMode) (*types.Package, error) } -func (W _go_types_ImporterFrom) Import(path string) (*types.Package, error) { return W.WImport(path) } +func (W _go_types_ImporterFrom) Import(path string) (*types.Package, error) { + return W.WImport(path) +} func (W _go_types_ImporterFrom) ImportFrom(path string, dir string, mode types.ImportMode) (*types.Package, error) { return W.WImportFrom(path, dir, mode) } // _go_types_Object is an interface wrapper for Object type type _go_types_Object struct { + IValue interface{} WExported func() bool WId func() string WName func() string @@ -190,31 +212,65 @@ type _go_types_Object struct { WType func() types.Type } -func (W _go_types_Object) Exported() bool { return W.WExported() } -func (W _go_types_Object) Id() string { return W.WId() } -func (W _go_types_Object) Name() string { return W.WName() } -func (W _go_types_Object) Parent() *types.Scope { return W.WParent() } -func (W _go_types_Object) Pkg() *types.Package { return W.WPkg() } -func (W _go_types_Object) Pos() token.Pos { return W.WPos() } -func (W _go_types_Object) String() string { return W.WString() } -func (W _go_types_Object) Type() types.Type { return W.WType() } +func (W _go_types_Object) Exported() bool { + return W.WExported() +} +func (W _go_types_Object) Id() string { + return W.WId() +} +func (W _go_types_Object) Name() string { + return W.WName() +} +func (W _go_types_Object) Parent() *types.Scope { + return W.WParent() +} +func (W _go_types_Object) Pkg() *types.Package { + return W.WPkg() +} +func (W _go_types_Object) Pos() token.Pos { + return W.WPos() +} +func (W _go_types_Object) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _go_types_Object) Type() types.Type { + return W.WType() +} // _go_types_Sizes is an interface wrapper for Sizes type type _go_types_Sizes struct { + IValue interface{} WAlignof func(T types.Type) int64 WOffsetsof func(fields []*types.Var) []int64 WSizeof func(T types.Type) int64 } -func (W _go_types_Sizes) Alignof(T types.Type) int64 { return W.WAlignof(T) } -func (W _go_types_Sizes) Offsetsof(fields []*types.Var) []int64 { return W.WOffsetsof(fields) } -func (W _go_types_Sizes) Sizeof(T types.Type) int64 { return W.WSizeof(T) } +func (W _go_types_Sizes) Alignof(T types.Type) int64 { + return W.WAlignof(T) +} +func (W _go_types_Sizes) Offsetsof(fields []*types.Var) []int64 { + return W.WOffsetsof(fields) +} +func (W _go_types_Sizes) Sizeof(T types.Type) int64 { + return W.WSizeof(T) +} // _go_types_Type is an interface wrapper for Type type type _go_types_Type struct { + IValue interface{} WString func() string WUnderlying func() types.Type } -func (W _go_types_Type) String() string { return W.WString() } -func (W _go_types_Type) Underlying() types.Type { return W.WUnderlying() } +func (W _go_types_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _go_types_Type) Underlying() types.Type { + return W.WUnderlying() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash.go new file mode 100644 index 0000000..d73a9c2 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash.go @@ -0,0 +1,111 @@ +// Code generated by 'yaegi extract hash'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "hash" + "reflect" +) + +func init() { + Symbols["hash/hash"] = map[string]reflect.Value{ + // type definitions + "Hash": reflect.ValueOf((*hash.Hash)(nil)), + "Hash32": reflect.ValueOf((*hash.Hash32)(nil)), + "Hash64": reflect.ValueOf((*hash.Hash64)(nil)), + + // interface wrapper definitions + "_Hash": reflect.ValueOf((*_hash_Hash)(nil)), + "_Hash32": reflect.ValueOf((*_hash_Hash32)(nil)), + "_Hash64": reflect.ValueOf((*_hash_Hash64)(nil)), + } +} + +// _hash_Hash is an interface wrapper for Hash type +type _hash_Hash struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash) Reset() { + W.WReset() +} +func (W _hash_Hash) Size() int { + return W.WSize() +} +func (W _hash_Hash) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} + +// _hash_Hash32 is an interface wrapper for Hash32 type +type _hash_Hash32 struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WSum32 func() uint32 + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash32) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash32) Reset() { + W.WReset() +} +func (W _hash_Hash32) Size() int { + return W.WSize() +} +func (W _hash_Hash32) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash32) Sum32() uint32 { + return W.WSum32() +} +func (W _hash_Hash32) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} + +// _hash_Hash64 is an interface wrapper for Hash64 type +type _hash_Hash64 struct { + IValue interface{} + WBlockSize func() int + WReset func() + WSize func() int + WSum func(b []byte) []byte + WSum64 func() uint64 + WWrite func(p []byte) (n int, err error) +} + +func (W _hash_Hash64) BlockSize() int { + return W.WBlockSize() +} +func (W _hash_Hash64) Reset() { + W.WReset() +} +func (W _hash_Hash64) Size() int { + return W.WSize() +} +func (W _hash_Hash64) Sum(b []byte) []byte { + return W.WSum(b) +} +func (W _hash_Hash64) Sum64() uint64 { + return W.WSum64() +} +func (W _hash_Hash64) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_adler32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_adler32.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_adler32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_adler32.go index 40c8667..97e920b 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_adler32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_adler32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/adler32'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/adler32"] = map[string]reflect.Value{ + Symbols["hash/adler32/adler32"] = map[string]reflect.Value{ // function, constant and variable definitions "Checksum": reflect.ValueOf(adler32.Checksum), "New": reflect.ValueOf(adler32.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc32.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc32.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc32.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc32.go index bf5724b..325548c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_crc32.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc32.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/crc32'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/crc32"] = map[string]reflect.Value{ + Symbols["hash/crc32/crc32"] = map[string]reflect.Value{ // function, constant and variable definitions "Castagnoli": reflect.ValueOf(constant.MakeFromLiteral("2197175160", token.INT, 0)), "Checksum": reflect.ValueOf(crc32.Checksum), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc64.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc64.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc64.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc64.go index 52711d1..5e83c3e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_crc64.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_crc64.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/crc64'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["hash/crc64"] = map[string]reflect.Value{ + Symbols["hash/crc64/crc64"] = map[string]reflect.Value{ // function, constant and variable definitions "Checksum": reflect.ValueOf(crc64.Checksum), "ECMA": reflect.ValueOf(constant.MakeFromLiteral("14514072000185962306", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_fnv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_fnv.go similarity index 83% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_fnv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_fnv.go index 2bfe4d5..f5471ab 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_hash_fnv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_fnv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/fnv'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["hash/fnv"] = map[string]reflect.Value{ + Symbols["hash/fnv/fnv"] = map[string]reflect.Value{ // function, constant and variable definitions "New128": reflect.ValueOf(fnv.New128), "New128a": reflect.ValueOf(fnv.New128a), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_maphash.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_maphash.go similarity index 65% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_maphash.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_maphash.go index 0d127cb..dc5d464 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_hash_maphash.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_hash_maphash.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract hash/maphash'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,9 +11,11 @@ import ( ) func init() { - Symbols["hash/maphash"] = map[string]reflect.Value{ + Symbols["hash/maphash/maphash"] = map[string]reflect.Value{ // function, constant and variable definitions + "Bytes": reflect.ValueOf(maphash.Bytes), "MakeSeed": reflect.ValueOf(maphash.MakeSeed), + "String": reflect.ValueOf(maphash.String), // type definitions "Hash": reflect.ValueOf((*maphash.Hash)(nil)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_html.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_html.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_html.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_html.go index 576a39e..7f070e1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_html.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_html.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract html'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["html"] = map[string]reflect.Value{ + Symbols["html/html"] = map[string]reflect.Value{ // function, constant and variable definitions "EscapeString": reflect.ValueOf(html.EscapeString), "UnescapeString": reflect.ValueOf(html.UnescapeString), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_html_template.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_html_template.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_html_template.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_html_template.go index 155b098..a660bb9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_html_template.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_html_template.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract html/template'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["html/template"] = map[string]reflect.Value{ + Symbols["html/template/template"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrAmbigContext": reflect.ValueOf(template.ErrAmbigContext), "ErrBadHTML": reflect.ValueOf(template.ErrBadHTML), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image.go similarity index 74% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image.go index 4210908..cbda85f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["image"] = map[string]reflect.Value{ + Symbols["image/image"] = map[string]reflect.Value{ // function, constant and variable definitions "Black": reflect.ValueOf(&image.Black).Elem(), "Decode": reflect.ValueOf(image.Decode), @@ -61,6 +62,7 @@ func init() { "Point": reflect.ValueOf((*image.Point)(nil)), "RGBA": reflect.ValueOf((*image.RGBA)(nil)), "RGBA64": reflect.ValueOf((*image.RGBA64)(nil)), + "RGBA64Image": reflect.ValueOf((*image.RGBA64Image)(nil)), "Rectangle": reflect.ValueOf((*image.Rectangle)(nil)), "Uniform": reflect.ValueOf((*image.Uniform)(nil)), "YCbCr": reflect.ValueOf((*image.YCbCr)(nil)), @@ -69,29 +71,68 @@ func init() { // interface wrapper definitions "_Image": reflect.ValueOf((*_image_Image)(nil)), "_PalettedImage": reflect.ValueOf((*_image_PalettedImage)(nil)), + "_RGBA64Image": reflect.ValueOf((*_image_RGBA64Image)(nil)), } } // _image_Image is an interface wrapper for Image type type _image_Image struct { + IValue interface{} WAt func(x int, y int) color.Color WBounds func() image.Rectangle WColorModel func() color.Model } -func (W _image_Image) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_Image) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_Image) ColorModel() color.Model { return W.WColorModel() } +func (W _image_Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_Image) ColorModel() color.Model { + return W.WColorModel() +} // _image_PalettedImage is an interface wrapper for PalettedImage type type _image_PalettedImage struct { + IValue interface{} WAt func(x int, y int) color.Color WBounds func() image.Rectangle WColorIndexAt func(x int, y int) uint8 WColorModel func() color.Model } -func (W _image_PalettedImage) At(x int, y int) color.Color { return W.WAt(x, y) } -func (W _image_PalettedImage) Bounds() image.Rectangle { return W.WBounds() } -func (W _image_PalettedImage) ColorIndexAt(x int, y int) uint8 { return W.WColorIndexAt(x, y) } -func (W _image_PalettedImage) ColorModel() color.Model { return W.WColorModel() } +func (W _image_PalettedImage) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_PalettedImage) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_PalettedImage) ColorIndexAt(x int, y int) uint8 { + return W.WColorIndexAt(x, y) +} +func (W _image_PalettedImage) ColorModel() color.Model { + return W.WColorModel() +} + +// _image_RGBA64Image is an interface wrapper for RGBA64Image type +type _image_RGBA64Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WRGBA64At func(x int, y int) color.RGBA64 +} + +func (W _image_RGBA64Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_RGBA64Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_RGBA64Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_RGBA64Image) RGBA64At(x int, y int) color.RGBA64 { + return W.WRGBA64At(x, y) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color.go index 7780555..9d78055 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/color'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/color"] = map[string]reflect.Value{ + Symbols["image/color/color"] = map[string]reflect.Value{ // function, constant and variable definitions "Alpha16Model": reflect.ValueOf(&color.Alpha16Model).Elem(), "AlphaModel": reflect.ValueOf(&color.AlphaModel).Elem(), @@ -57,14 +58,20 @@ func init() { // _image_color_Color is an interface wrapper for Color type type _image_color_Color struct { - WRGBA func() (r uint32, g uint32, b uint32, a uint32) + IValue interface{} + WRGBA func() (r uint32, g uint32, b uint32, a uint32) } -func (W _image_color_Color) RGBA() (r uint32, g uint32, b uint32, a uint32) { return W.WRGBA() } +func (W _image_color_Color) RGBA() (r uint32, g uint32, b uint32, a uint32) { + return W.WRGBA() +} // _image_color_Model is an interface wrapper for Model type type _image_color_Model struct { + IValue interface{} WConvert func(c color.Color) color.Color } -func (W _image_color_Model) Convert(c color.Color) color.Color { return W.WConvert(c) } +func (W _image_color_Model) Convert(c color.Color) color.Color { + return W.WConvert(c) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color_palette.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color_palette.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color_palette.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color_palette.go index 952115d..50001dd 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_color_palette.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_color_palette.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/color/palette'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/color/palette"] = map[string]reflect.Value{ + Symbols["image/color/palette/palette"] = map[string]reflect.Value{ // function, constant and variable definitions "Plan9": reflect.ValueOf(&palette.Plan9).Elem(), "WebSafe": reflect.ValueOf(&palette.WebSafe).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_draw.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_draw.go new file mode 100644 index 0000000..d298dde --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_draw.go @@ -0,0 +1,109 @@ +// Code generated by 'yaegi extract image/draw'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "image" + "image/color" + "image/draw" + "reflect" +) + +func init() { + Symbols["image/draw/draw"] = map[string]reflect.Value{ + // function, constant and variable definitions + "Draw": reflect.ValueOf(draw.Draw), + "DrawMask": reflect.ValueOf(draw.DrawMask), + "FloydSteinberg": reflect.ValueOf(&draw.FloydSteinberg).Elem(), + "Over": reflect.ValueOf(draw.Over), + "Src": reflect.ValueOf(draw.Src), + + // type definitions + "Drawer": reflect.ValueOf((*draw.Drawer)(nil)), + "Image": reflect.ValueOf((*draw.Image)(nil)), + "Op": reflect.ValueOf((*draw.Op)(nil)), + "Quantizer": reflect.ValueOf((*draw.Quantizer)(nil)), + "RGBA64Image": reflect.ValueOf((*draw.RGBA64Image)(nil)), + + // interface wrapper definitions + "_Drawer": reflect.ValueOf((*_image_draw_Drawer)(nil)), + "_Image": reflect.ValueOf((*_image_draw_Image)(nil)), + "_Quantizer": reflect.ValueOf((*_image_draw_Quantizer)(nil)), + "_RGBA64Image": reflect.ValueOf((*_image_draw_RGBA64Image)(nil)), + } +} + +// _image_draw_Drawer is an interface wrapper for Drawer type +type _image_draw_Drawer struct { + IValue interface{} + WDraw func(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) +} + +func (W _image_draw_Drawer) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) { + W.WDraw(dst, r, src, sp) +} + +// _image_draw_Image is an interface wrapper for Image type +type _image_draw_Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WSet func(x int, y int, c color.Color) +} + +func (W _image_draw_Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_draw_Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_draw_Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_draw_Image) Set(x int, y int, c color.Color) { + W.WSet(x, y, c) +} + +// _image_draw_Quantizer is an interface wrapper for Quantizer type +type _image_draw_Quantizer struct { + IValue interface{} + WQuantize func(p color.Palette, m image.Image) color.Palette +} + +func (W _image_draw_Quantizer) Quantize(p color.Palette, m image.Image) color.Palette { + return W.WQuantize(p, m) +} + +// _image_draw_RGBA64Image is an interface wrapper for RGBA64Image type +type _image_draw_RGBA64Image struct { + IValue interface{} + WAt func(x int, y int) color.Color + WBounds func() image.Rectangle + WColorModel func() color.Model + WRGBA64At func(x int, y int) color.RGBA64 + WSet func(x int, y int, c color.Color) + WSetRGBA64 func(x int, y int, c color.RGBA64) +} + +func (W _image_draw_RGBA64Image) At(x int, y int) color.Color { + return W.WAt(x, y) +} +func (W _image_draw_RGBA64Image) Bounds() image.Rectangle { + return W.WBounds() +} +func (W _image_draw_RGBA64Image) ColorModel() color.Model { + return W.WColorModel() +} +func (W _image_draw_RGBA64Image) RGBA64At(x int, y int) color.RGBA64 { + return W.WRGBA64At(x, y) +} +func (W _image_draw_RGBA64Image) Set(x int, y int, c color.Color) { + W.WSet(x, y, c) +} +func (W _image_draw_RGBA64Image) SetRGBA64(x int, y int, c color.RGBA64) { + W.WSetRGBA64(x, y, c) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_gif.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_gif.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image_gif.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image_gif.go index b95828e..e13d32a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_gif.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_gif.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/gif'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["image/gif"] = map[string]reflect.Value{ + Symbols["image/gif/gif"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(gif.Decode), "DecodeAll": reflect.ValueOf(gif.DecodeAll), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_jpeg.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_jpeg.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_image_jpeg.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image_jpeg.go index eb3d03b..e028fe0 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_image_jpeg.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_jpeg.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/jpeg'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["image/jpeg"] = map[string]reflect.Value{ + Symbols["image/jpeg/jpeg"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(jpeg.Decode), "DecodeConfig": reflect.ValueOf(jpeg.DecodeConfig), @@ -32,9 +33,14 @@ func init() { // _image_jpeg_Reader is an interface wrapper for Reader type type _image_jpeg_Reader struct { + IValue interface{} WRead func(p []byte) (n int, err error) WReadByte func() (byte, error) } -func (W _image_jpeg_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _image_jpeg_Reader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _image_jpeg_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _image_jpeg_Reader) ReadByte() (byte, error) { + return W.WReadByte() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_png.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_png.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_image_png.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_image_png.go index 6dbc172..db866e0 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_image_png.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_image_png.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract image/png'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["image/png"] = map[string]reflect.Value{ + Symbols["image/png/png"] = map[string]reflect.Value{ // function, constant and variable definitions "BestCompression": reflect.ValueOf(png.BestCompression), "BestSpeed": reflect.ValueOf(png.BestSpeed), @@ -35,9 +36,14 @@ func init() { // _image_png_EncoderBufferPool is an interface wrapper for EncoderBufferPool type type _image_png_EncoderBufferPool struct { - WGet func() *png.EncoderBuffer - WPut func(a0 *png.EncoderBuffer) + IValue interface{} + WGet func() *png.EncoderBuffer + WPut func(a0 *png.EncoderBuffer) } -func (W _image_png_EncoderBufferPool) Get() *png.EncoderBuffer { return W.WGet() } -func (W _image_png_EncoderBufferPool) Put(a0 *png.EncoderBuffer) { W.WPut(a0) } +func (W _image_png_EncoderBufferPool) Get() *png.EncoderBuffer { + return W.WGet() +} +func (W _image_png_EncoderBufferPool) Put(a0 *png.EncoderBuffer) { + W.WPut(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_index_suffixarray.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_index_suffixarray.go similarity index 75% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_index_suffixarray.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_index_suffixarray.go index 82d1cb4..3125548 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_index_suffixarray.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_index_suffixarray.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract index/suffixarray'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["index/suffixarray"] = map[string]reflect.Value{ + Symbols["index/suffixarray/suffixarray"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(suffixarray.New), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_io.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_io.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_io.go index 11a5d3b..83ffbd5 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_io.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract io'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["io"] = map[string]reflect.Value{ + Symbols["io/io"] = map[string]reflect.Value{ // function, constant and variable definitions "Copy": reflect.ValueOf(io.Copy), "CopyBuffer": reflect.ValueOf(io.CopyBuffer), @@ -95,160 +96,235 @@ func init() { // _io_ByteReader is an interface wrapper for ByteReader type type _io_ByteReader struct { + IValue interface{} WReadByte func() (byte, error) } -func (W _io_ByteReader) ReadByte() (byte, error) { return W.WReadByte() } +func (W _io_ByteReader) ReadByte() (byte, error) { + return W.WReadByte() +} // _io_ByteScanner is an interface wrapper for ByteScanner type type _io_ByteScanner struct { + IValue interface{} WReadByte func() (byte, error) WUnreadByte func() error } -func (W _io_ByteScanner) ReadByte() (byte, error) { return W.WReadByte() } -func (W _io_ByteScanner) UnreadByte() error { return W.WUnreadByte() } +func (W _io_ByteScanner) ReadByte() (byte, error) { + return W.WReadByte() +} +func (W _io_ByteScanner) UnreadByte() error { + return W.WUnreadByte() +} // _io_ByteWriter is an interface wrapper for ByteWriter type type _io_ByteWriter struct { + IValue interface{} WWriteByte func(c byte) error } -func (W _io_ByteWriter) WriteByte(c byte) error { return W.WWriteByte(c) } +func (W _io_ByteWriter) WriteByte(c byte) error { + return W.WWriteByte(c) +} // _io_Closer is an interface wrapper for Closer type type _io_Closer struct { + IValue interface{} WClose func() error } -func (W _io_Closer) Close() error { return W.WClose() } +func (W _io_Closer) Close() error { + return W.WClose() +} // _io_ReadCloser is an interface wrapper for ReadCloser type type _io_ReadCloser struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) } -func (W _io_ReadCloser) Close() error { return W.WClose() } -func (W _io_ReadCloser) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_ReadCloser) Close() error { + return W.WClose() +} +func (W _io_ReadCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} // _io_ReadSeekCloser is an interface wrapper for ReadSeekCloser type type _io_ReadSeekCloser struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WSeek func(offset int64, whence int) (int64, error) } -func (W _io_ReadSeekCloser) Close() error { return W.WClose() } -func (W _io_ReadSeekCloser) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_ReadSeekCloser) Close() error { + return W.WClose() +} +func (W _io_ReadSeekCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} func (W _io_ReadSeekCloser) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } // _io_ReadSeeker is an interface wrapper for ReadSeeker type type _io_ReadSeeker struct { - WRead func(p []byte) (n int, err error) - WSeek func(offset int64, whence int) (int64, error) + IValue interface{} + WRead func(p []byte) (n int, err error) + WSeek func(offset int64, whence int) (int64, error) } -func (W _io_ReadSeeker) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } +func (W _io_ReadSeeker) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadSeeker) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} // _io_ReadWriteCloser is an interface wrapper for ReadWriteCloser type type _io_ReadWriteCloser struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriteCloser) Close() error { return W.WClose() } -func (W _io_ReadWriteCloser) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadWriteCloser) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriteCloser) Close() error { + return W.WClose() +} +func (W _io_ReadWriteCloser) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadWriteCloser) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_ReadWriteSeeker is an interface wrapper for ReadWriteSeeker type type _io_ReadWriteSeeker struct { + IValue interface{} WRead func(p []byte) (n int, err error) WSeek func(offset int64, whence int) (int64, error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriteSeeker) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_ReadWriteSeeker) Read(p []byte) (n int, err error) { + return W.WRead(p) +} func (W _io_ReadWriteSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _io_ReadWriteSeeker) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriteSeeker) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_ReadWriter is an interface wrapper for ReadWriter type type _io_ReadWriter struct { + IValue interface{} WRead func(p []byte) (n int, err error) WWrite func(p []byte) (n int, err error) } -func (W _io_ReadWriter) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _io_ReadWriter) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_ReadWriter) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _io_ReadWriter) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_Reader is an interface wrapper for Reader type type _io_Reader struct { - WRead func(p []byte) (n int, err error) + IValue interface{} + WRead func(p []byte) (n int, err error) } -func (W _io_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _io_Reader) Read(p []byte) (n int, err error) { + return W.WRead(p) +} // _io_ReaderAt is an interface wrapper for ReaderAt type type _io_ReaderAt struct { + IValue interface{} WReadAt func(p []byte, off int64) (n int, err error) } -func (W _io_ReaderAt) ReadAt(p []byte, off int64) (n int, err error) { return W.WReadAt(p, off) } +func (W _io_ReaderAt) ReadAt(p []byte, off int64) (n int, err error) { + return W.WReadAt(p, off) +} // _io_ReaderFrom is an interface wrapper for ReaderFrom type type _io_ReaderFrom struct { + IValue interface{} WReadFrom func(r io.Reader) (n int64, err error) } -func (W _io_ReaderFrom) ReadFrom(r io.Reader) (n int64, err error) { return W.WReadFrom(r) } +func (W _io_ReaderFrom) ReadFrom(r io.Reader) (n int64, err error) { + return W.WReadFrom(r) +} // _io_RuneReader is an interface wrapper for RuneReader type type _io_RuneReader struct { + IValue interface{} WReadRune func() (r rune, size int, err error) } -func (W _io_RuneReader) ReadRune() (r rune, size int, err error) { return W.WReadRune() } +func (W _io_RuneReader) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} // _io_RuneScanner is an interface wrapper for RuneScanner type type _io_RuneScanner struct { + IValue interface{} WReadRune func() (r rune, size int, err error) WUnreadRune func() error } -func (W _io_RuneScanner) ReadRune() (r rune, size int, err error) { return W.WReadRune() } -func (W _io_RuneScanner) UnreadRune() error { return W.WUnreadRune() } +func (W _io_RuneScanner) ReadRune() (r rune, size int, err error) { + return W.WReadRune() +} +func (W _io_RuneScanner) UnreadRune() error { + return W.WUnreadRune() +} // _io_Seeker is an interface wrapper for Seeker type type _io_Seeker struct { - WSeek func(offset int64, whence int) (int64, error) + IValue interface{} + WSeek func(offset int64, whence int) (int64, error) } -func (W _io_Seeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } +func (W _io_Seeker) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} // _io_StringWriter is an interface wrapper for StringWriter type type _io_StringWriter struct { + IValue interface{} WWriteString func(s string) (n int, err error) } -func (W _io_StringWriter) WriteString(s string) (n int, err error) { return W.WWriteString(s) } +func (W _io_StringWriter) WriteString(s string) (n int, err error) { + return W.WWriteString(s) +} // _io_WriteCloser is an interface wrapper for WriteCloser type type _io_WriteCloser struct { + IValue interface{} WClose func() error WWrite func(p []byte) (n int, err error) } -func (W _io_WriteCloser) Close() error { return W.WClose() } -func (W _io_WriteCloser) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_WriteCloser) Close() error { + return W.WClose() +} +func (W _io_WriteCloser) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_WriteSeeker is an interface wrapper for WriteSeeker type type _io_WriteSeeker struct { + IValue interface{} WSeek func(offset int64, whence int) (int64, error) WWrite func(p []byte) (n int, err error) } @@ -256,25 +332,36 @@ type _io_WriteSeeker struct { func (W _io_WriteSeeker) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _io_WriteSeeker) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_WriteSeeker) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_Writer is an interface wrapper for Writer type type _io_Writer struct { + IValue interface{} WWrite func(p []byte) (n int, err error) } -func (W _io_Writer) Write(p []byte) (n int, err error) { return W.WWrite(p) } +func (W _io_Writer) Write(p []byte) (n int, err error) { + return W.WWrite(p) +} // _io_WriterAt is an interface wrapper for WriterAt type type _io_WriterAt struct { + IValue interface{} WWriteAt func(p []byte, off int64) (n int, err error) } -func (W _io_WriterAt) WriteAt(p []byte, off int64) (n int, err error) { return W.WWriteAt(p, off) } +func (W _io_WriterAt) WriteAt(p []byte, off int64) (n int, err error) { + return W.WWriteAt(p, off) +} // _io_WriterTo is an interface wrapper for WriterTo type type _io_WriterTo struct { + IValue interface{} WWriteTo func(w io.Writer) (n int64, err error) } -func (W _io_WriterTo) WriteTo(w io.Writer) (n int64, err error) { return W.WWriteTo(w) } +func (W _io_WriterTo) WriteTo(w io.Writer) (n int64, err error) { + return W.WWriteTo(w) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_io_fs.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io_fs.go new file mode 100644 index 0000000..1effe3e --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io_fs.go @@ -0,0 +1,246 @@ +// Code generated by 'yaegi extract io/fs'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "io/fs" + "reflect" + "time" +) + +func init() { + Symbols["io/fs/fs"] = map[string]reflect.Value{ + // function, constant and variable definitions + "ErrClosed": reflect.ValueOf(&fs.ErrClosed).Elem(), + "ErrExist": reflect.ValueOf(&fs.ErrExist).Elem(), + "ErrInvalid": reflect.ValueOf(&fs.ErrInvalid).Elem(), + "ErrNotExist": reflect.ValueOf(&fs.ErrNotExist).Elem(), + "ErrPermission": reflect.ValueOf(&fs.ErrPermission).Elem(), + "FileInfoToDirEntry": reflect.ValueOf(fs.FileInfoToDirEntry), + "Glob": reflect.ValueOf(fs.Glob), + "ModeAppend": reflect.ValueOf(fs.ModeAppend), + "ModeCharDevice": reflect.ValueOf(fs.ModeCharDevice), + "ModeDevice": reflect.ValueOf(fs.ModeDevice), + "ModeDir": reflect.ValueOf(fs.ModeDir), + "ModeExclusive": reflect.ValueOf(fs.ModeExclusive), + "ModeIrregular": reflect.ValueOf(fs.ModeIrregular), + "ModeNamedPipe": reflect.ValueOf(fs.ModeNamedPipe), + "ModePerm": reflect.ValueOf(fs.ModePerm), + "ModeSetgid": reflect.ValueOf(fs.ModeSetgid), + "ModeSetuid": reflect.ValueOf(fs.ModeSetuid), + "ModeSocket": reflect.ValueOf(fs.ModeSocket), + "ModeSticky": reflect.ValueOf(fs.ModeSticky), + "ModeSymlink": reflect.ValueOf(fs.ModeSymlink), + "ModeTemporary": reflect.ValueOf(fs.ModeTemporary), + "ModeType": reflect.ValueOf(fs.ModeType), + "ReadDir": reflect.ValueOf(fs.ReadDir), + "ReadFile": reflect.ValueOf(fs.ReadFile), + "SkipDir": reflect.ValueOf(&fs.SkipDir).Elem(), + "Stat": reflect.ValueOf(fs.Stat), + "Sub": reflect.ValueOf(fs.Sub), + "ValidPath": reflect.ValueOf(fs.ValidPath), + "WalkDir": reflect.ValueOf(fs.WalkDir), + + // type definitions + "DirEntry": reflect.ValueOf((*fs.DirEntry)(nil)), + "FS": reflect.ValueOf((*fs.FS)(nil)), + "File": reflect.ValueOf((*fs.File)(nil)), + "FileInfo": reflect.ValueOf((*fs.FileInfo)(nil)), + "FileMode": reflect.ValueOf((*fs.FileMode)(nil)), + "GlobFS": reflect.ValueOf((*fs.GlobFS)(nil)), + "PathError": reflect.ValueOf((*fs.PathError)(nil)), + "ReadDirFS": reflect.ValueOf((*fs.ReadDirFS)(nil)), + "ReadDirFile": reflect.ValueOf((*fs.ReadDirFile)(nil)), + "ReadFileFS": reflect.ValueOf((*fs.ReadFileFS)(nil)), + "StatFS": reflect.ValueOf((*fs.StatFS)(nil)), + "SubFS": reflect.ValueOf((*fs.SubFS)(nil)), + "WalkDirFunc": reflect.ValueOf((*fs.WalkDirFunc)(nil)), + + // interface wrapper definitions + "_DirEntry": reflect.ValueOf((*_io_fs_DirEntry)(nil)), + "_FS": reflect.ValueOf((*_io_fs_FS)(nil)), + "_File": reflect.ValueOf((*_io_fs_File)(nil)), + "_FileInfo": reflect.ValueOf((*_io_fs_FileInfo)(nil)), + "_GlobFS": reflect.ValueOf((*_io_fs_GlobFS)(nil)), + "_ReadDirFS": reflect.ValueOf((*_io_fs_ReadDirFS)(nil)), + "_ReadDirFile": reflect.ValueOf((*_io_fs_ReadDirFile)(nil)), + "_ReadFileFS": reflect.ValueOf((*_io_fs_ReadFileFS)(nil)), + "_StatFS": reflect.ValueOf((*_io_fs_StatFS)(nil)), + "_SubFS": reflect.ValueOf((*_io_fs_SubFS)(nil)), + } +} + +// _io_fs_DirEntry is an interface wrapper for DirEntry type +type _io_fs_DirEntry struct { + IValue interface{} + WInfo func() (fs.FileInfo, error) + WIsDir func() bool + WName func() string + WType func() fs.FileMode +} + +func (W _io_fs_DirEntry) Info() (fs.FileInfo, error) { + return W.WInfo() +} +func (W _io_fs_DirEntry) IsDir() bool { + return W.WIsDir() +} +func (W _io_fs_DirEntry) Name() string { + return W.WName() +} +func (W _io_fs_DirEntry) Type() fs.FileMode { + return W.WType() +} + +// _io_fs_FS is an interface wrapper for FS type +type _io_fs_FS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) +} + +func (W _io_fs_FS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} + +// _io_fs_File is an interface wrapper for File type +type _io_fs_File struct { + IValue interface{} + WClose func() error + WRead func(a0 []byte) (int, error) + WStat func() (fs.FileInfo, error) +} + +func (W _io_fs_File) Close() error { + return W.WClose() +} +func (W _io_fs_File) Read(a0 []byte) (int, error) { + return W.WRead(a0) +} +func (W _io_fs_File) Stat() (fs.FileInfo, error) { + return W.WStat() +} + +// _io_fs_FileInfo is an interface wrapper for FileInfo type +type _io_fs_FileInfo struct { + IValue interface{} + WIsDir func() bool + WModTime func() time.Time + WMode func() fs.FileMode + WName func() string + WSize func() int64 + WSys func() any +} + +func (W _io_fs_FileInfo) IsDir() bool { + return W.WIsDir() +} +func (W _io_fs_FileInfo) ModTime() time.Time { + return W.WModTime() +} +func (W _io_fs_FileInfo) Mode() fs.FileMode { + return W.WMode() +} +func (W _io_fs_FileInfo) Name() string { + return W.WName() +} +func (W _io_fs_FileInfo) Size() int64 { + return W.WSize() +} +func (W _io_fs_FileInfo) Sys() any { + return W.WSys() +} + +// _io_fs_GlobFS is an interface wrapper for GlobFS type +type _io_fs_GlobFS struct { + IValue interface{} + WGlob func(pattern string) ([]string, error) + WOpen func(name string) (fs.File, error) +} + +func (W _io_fs_GlobFS) Glob(pattern string) ([]string, error) { + return W.WGlob(pattern) +} +func (W _io_fs_GlobFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} + +// _io_fs_ReadDirFS is an interface wrapper for ReadDirFS type +type _io_fs_ReadDirFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WReadDir func(name string) ([]fs.DirEntry, error) +} + +func (W _io_fs_ReadDirFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_ReadDirFS) ReadDir(name string) ([]fs.DirEntry, error) { + return W.WReadDir(name) +} + +// _io_fs_ReadDirFile is an interface wrapper for ReadDirFile type +type _io_fs_ReadDirFile struct { + IValue interface{} + WClose func() error + WRead func(a0 []byte) (int, error) + WReadDir func(n int) ([]fs.DirEntry, error) + WStat func() (fs.FileInfo, error) +} + +func (W _io_fs_ReadDirFile) Close() error { + return W.WClose() +} +func (W _io_fs_ReadDirFile) Read(a0 []byte) (int, error) { + return W.WRead(a0) +} +func (W _io_fs_ReadDirFile) ReadDir(n int) ([]fs.DirEntry, error) { + return W.WReadDir(n) +} +func (W _io_fs_ReadDirFile) Stat() (fs.FileInfo, error) { + return W.WStat() +} + +// _io_fs_ReadFileFS is an interface wrapper for ReadFileFS type +type _io_fs_ReadFileFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WReadFile func(name string) ([]byte, error) +} + +func (W _io_fs_ReadFileFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_ReadFileFS) ReadFile(name string) ([]byte, error) { + return W.WReadFile(name) +} + +// _io_fs_StatFS is an interface wrapper for StatFS type +type _io_fs_StatFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WStat func(name string) (fs.FileInfo, error) +} + +func (W _io_fs_StatFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_StatFS) Stat(name string) (fs.FileInfo, error) { + return W.WStat(name) +} + +// _io_fs_SubFS is an interface wrapper for SubFS type +type _io_fs_SubFS struct { + IValue interface{} + WOpen func(name string) (fs.File, error) + WSub func(dir string) (fs.FS, error) +} + +func (W _io_fs_SubFS) Open(name string) (fs.File, error) { + return W.WOpen(name) +} +func (W _io_fs_SubFS) Sub(dir string) (fs.FS, error) { + return W.WSub(dir) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_io_ioutil.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io_ioutil.go similarity index 86% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_io_ioutil.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_io_ioutil.go index 3e07985..3c5d54a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_io_ioutil.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_io_ioutil.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract io/ioutil'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["io/ioutil"] = map[string]reflect.Value{ + Symbols["io/ioutil/ioutil"] = map[string]reflect.Value{ // function, constant and variable definitions "Discard": reflect.ValueOf(&ioutil.Discard).Elem(), "NopCloser": reflect.ValueOf(ioutil.NopCloser), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_log.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_log.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_log.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_log.go index c409ca2..a6aa324 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_log.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_log.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract log'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["log"] = map[string]reflect.Value{ + Symbols["log/log"] = map[string]reflect.Value{ // function, constant and variable definitions "Default": reflect.ValueOf(log.Default), "Fatal": reflect.ValueOf(logFatal), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_log_syslog.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_log_syslog.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_log_syslog.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_log_syslog.go index e9bfedc..1b691e1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_log_syslog.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_log_syslog.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract log/syslog'. DO NOT EDIT. -// +build go1.15,!go1.16,!windows,!nacl,!plan9 +//go:build go1.19 && !windows && !nacl && !plan9 +// +build go1.19,!windows,!nacl,!plan9 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["log/syslog"] = map[string]reflect.Value{ + Symbols["log/syslog/syslog"] = map[string]reflect.Value{ // function, constant and variable definitions "Dial": reflect.ValueOf(syslog.Dial), "LOG_ALERT": reflect.ValueOf(syslog.LOG_ALERT), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_math.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_math.go index 6010672..70258ed 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math"] = map[string]reflect.Value{ + Symbols["math/math"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(math.Abs), "Acos": reflect.ValueOf(math.Acos), @@ -65,16 +66,19 @@ func init() { "Logb": reflect.ValueOf(math.Logb), "Max": reflect.ValueOf(math.Max), "MaxFloat32": reflect.ValueOf(constant.MakeFromLiteral("340282346638528859811704183484516925440", token.FLOAT, 0)), - "MaxFloat64": reflect.ValueOf(constant.MakeFromLiteral("179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", token.FLOAT, 0)), + "MaxFloat64": reflect.ValueOf(constant.MakeFromLiteral("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368", token.FLOAT, 0)), + "MaxInt": reflect.ValueOf(constant.MakeFromLiteral("9223372036854775807", token.INT, 0)), "MaxInt16": reflect.ValueOf(constant.MakeFromLiteral("32767", token.INT, 0)), "MaxInt32": reflect.ValueOf(constant.MakeFromLiteral("2147483647", token.INT, 0)), "MaxInt64": reflect.ValueOf(constant.MakeFromLiteral("9223372036854775807", token.INT, 0)), "MaxInt8": reflect.ValueOf(constant.MakeFromLiteral("127", token.INT, 0)), + "MaxUint": reflect.ValueOf(constant.MakeFromLiteral("18446744073709551615", token.INT, 0)), "MaxUint16": reflect.ValueOf(constant.MakeFromLiteral("65535", token.INT, 0)), "MaxUint32": reflect.ValueOf(constant.MakeFromLiteral("4294967295", token.INT, 0)), "MaxUint64": reflect.ValueOf(constant.MakeFromLiteral("18446744073709551615", token.INT, 0)), "MaxUint8": reflect.ValueOf(constant.MakeFromLiteral("255", token.INT, 0)), "Min": reflect.ValueOf(math.Min), + "MinInt": reflect.ValueOf(constant.MakeFromLiteral("-9223372036854775808", token.INT, 0)), "MinInt16": reflect.ValueOf(constant.MakeFromLiteral("-32768", token.INT, 0)), "MinInt32": reflect.ValueOf(constant.MakeFromLiteral("-2147483648", token.INT, 0)), "MinInt64": reflect.ValueOf(constant.MakeFromLiteral("-9223372036854775808", token.INT, 0)), @@ -95,8 +99,8 @@ func init() { "Sin": reflect.ValueOf(math.Sin), "Sincos": reflect.ValueOf(math.Sincos), "Sinh": reflect.ValueOf(math.Sinh), - "SmallestNonzeroFloat32": reflect.ValueOf(constant.MakeFromLiteral("1.40129846432481707092372958328991613128000000000000000000000000000000000000000000001246655487714533538006789189734126694785975183981128816138510360971472225738624150874949653910667523779981133927289771669016713539217953030564201688027906006008453304556102801950542906382507e-45", token.FLOAT, 0)), - "SmallestNonzeroFloat64": reflect.ValueOf(constant.MakeFromLiteral("4.94065645841246544176568792868221372365099999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999916206614696136086629714037163874026187912451674985660337336755242863513549746484310667379088263176934591818322489862214324814281481943599945502119376688748731948897748561110123901991443297110206447991752071007926740839424145013355231935665542622515363894390826799291671723318261174778903704064716351336223785714389641180220184242018383103204287325861250404139399888498504162666394779407509786431980433771341978183418568838015304951087487907666317075235615216699116844779095660202193409146032665221882798856203896125090454090026556150624798681464913851491093798848436664885581161128190046248588053014958829424991704801027040654863867512297941601850496672190315253109308532379657238854928816482120688440415705411555019932096150435627305446214567713171657554140575630917301482608119551500514805985376055777894871863446222606532650275466165274006e-324", token.FLOAT, 0)), + "SmallestNonzeroFloat32": reflect.ValueOf(constant.MakeFromLiteral("1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45", token.FLOAT, 0)), + "SmallestNonzeroFloat64": reflect.ValueOf(constant.MakeFromLiteral("4.940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625e-324", token.FLOAT, 0)), "Sqrt": reflect.ValueOf(math.Sqrt), "Sqrt2": reflect.ValueOf(constant.MakeFromLiteral("1.414213562373095048801688724209698078569671875376948073176679739576083351575381440094441524123797447886801949755143139115339040409162552642832693297721230919563348109313505318596071447245776653289794921875", token.FLOAT, 0)), "SqrtE": reflect.ValueOf(constant.MakeFromLiteral("1.64872127070012814684865078781416357165377610071014801157507931167328763229187870850146925823776361770041160388013884200789716007979526823569827080974091691342077871211546646890155898290686309337615966796875", token.FLOAT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_big.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_big.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_math_big.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_math_big.go index 6ee45a3..ca24c52 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_math_big.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_big.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/big'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math/big"] = map[string]reflect.Value{ + Symbols["math/big/big"] = map[string]reflect.Value{ // function, constant and variable definitions "Above": reflect.ValueOf(big.Above), "AwayFromZero": reflect.ValueOf(big.AwayFromZero), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_bits.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_bits.go similarity index 97% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_math_bits.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_math_bits.go index beb4818..247c5f3 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_bits.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_bits.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/bits'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["math/bits"] = map[string]reflect.Value{ + Symbols["math/bits/bits"] = map[string]reflect.Value{ // function, constant and variable definitions "Add": reflect.ValueOf(bits.Add), "Add32": reflect.ValueOf(bits.Add32), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_cmplx.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_cmplx.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_math_cmplx.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_math_cmplx.go index d5c8509..ab5b4c9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_cmplx.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_cmplx.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/cmplx'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["math/cmplx"] = map[string]reflect.Value{ + Symbols["math/cmplx/cmplx"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(cmplx.Abs), "Acos": reflect.ValueOf(cmplx.Acos), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_rand.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_rand.go similarity index 79% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_math_rand.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_math_rand.go index 24a6fad..b25ad36 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_math_rand.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_math_rand.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract math/rand'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["math/rand"] = map[string]reflect.Value{ + Symbols["math/rand/rand"] = map[string]reflect.Value{ // function, constant and variable definitions "ExpFloat64": reflect.ValueOf(rand.ExpFloat64), "Float32": reflect.ValueOf(rand.Float32), @@ -46,20 +47,32 @@ func init() { // _math_rand_Source is an interface wrapper for Source type type _math_rand_Source struct { + IValue interface{} WInt63 func() int64 WSeed func(seed int64) } -func (W _math_rand_Source) Int63() int64 { return W.WInt63() } -func (W _math_rand_Source) Seed(seed int64) { W.WSeed(seed) } +func (W _math_rand_Source) Int63() int64 { + return W.WInt63() +} +func (W _math_rand_Source) Seed(seed int64) { + W.WSeed(seed) +} // _math_rand_Source64 is an interface wrapper for Source64 type type _math_rand_Source64 struct { + IValue interface{} WInt63 func() int64 WSeed func(seed int64) WUint64 func() uint64 } -func (W _math_rand_Source64) Int63() int64 { return W.WInt63() } -func (W _math_rand_Source64) Seed(seed int64) { W.WSeed(seed) } -func (W _math_rand_Source64) Uint64() uint64 { return W.WUint64() } +func (W _math_rand_Source64) Int63() int64 { + return W.WInt63() +} +func (W _math_rand_Source64) Seed(seed int64) { + W.WSeed(seed) +} +func (W _math_rand_Source64) Uint64() uint64 { + return W.WUint64() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_mime.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_mime.go index 9f0b03b..e8dd5aa 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime"] = map[string]reflect.Value{ + Symbols["mime/mime"] = map[string]reflect.Value{ // function, constant and variable definitions "AddExtensionType": reflect.ValueOf(mime.AddExtensionType), "BEncoding": reflect.ValueOf(mime.BEncoding), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_multipart.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_multipart.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_multipart.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_multipart.go index 7aee147..a324b61 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_mime_multipart.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_multipart.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime/multipart'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime/multipart"] = map[string]reflect.Value{ + Symbols["mime/multipart/multipart"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrMessageTooLarge": reflect.ValueOf(&multipart.ErrMessageTooLarge).Elem(), "NewReader": reflect.ValueOf(multipart.NewReader), @@ -31,14 +32,19 @@ func init() { // _mime_multipart_File is an interface wrapper for File type type _mime_multipart_File struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) WReadAt func(p []byte, off int64) (n int, err error) WSeek func(offset int64, whence int) (int64, error) } -func (W _mime_multipart_File) Close() error { return W.WClose() } -func (W _mime_multipart_File) Read(p []byte) (n int, err error) { return W.WRead(p) } +func (W _mime_multipart_File) Close() error { + return W.WClose() +} +func (W _mime_multipart_File) Read(p []byte) (n int, err error) { + return W.WRead(p) +} func (W _mime_multipart_File) ReadAt(p []byte, off int64) (n int, err error) { return W.WReadAt(p, off) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_quotedprintable.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_quotedprintable.go similarity index 80% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_quotedprintable.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_quotedprintable.go index 7c0bcb4..28aa61e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_mime_quotedprintable.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_mime_quotedprintable.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract mime/quotedprintable'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["mime/quotedprintable"] = map[string]reflect.Value{ + Symbols["mime/quotedprintable/quotedprintable"] = map[string]reflect.Value{ // function, constant and variable definitions "NewReader": reflect.ValueOf(quotedprintable.NewReader), "NewWriter": reflect.ValueOf(quotedprintable.NewWriter), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net.go index 335b054..3419be6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -13,7 +14,7 @@ import ( ) func init() { - Symbols["net"] = map[string]reflect.Value{ + Symbols["net/net"] = map[string]reflect.Value{ // function, constant and variable definitions "CIDRMask": reflect.ValueOf(net.CIDRMask), "DefaultResolver": reflect.ValueOf(&net.DefaultResolver).Elem(), @@ -78,6 +79,8 @@ func init() { "ResolveUDPAddr": reflect.ValueOf(net.ResolveUDPAddr), "ResolveUnixAddr": reflect.ValueOf(net.ResolveUnixAddr), "SplitHostPort": reflect.ValueOf(net.SplitHostPort), + "TCPAddrFromAddrPort": reflect.ValueOf(net.TCPAddrFromAddrPort), + "UDPAddrFromAddrPort": reflect.ValueOf(net.UDPAddrFromAddrPort), // type definitions "Addr": reflect.ValueOf((*net.Addr)(nil)), @@ -127,15 +130,24 @@ func init() { // _net_Addr is an interface wrapper for Addr type type _net_Addr struct { + IValue interface{} WNetwork func() string WString func() string } -func (W _net_Addr) Network() string { return W.WNetwork() } -func (W _net_Addr) String() string { return W.WString() } +func (W _net_Addr) Network() string { + return W.WNetwork() +} +func (W _net_Addr) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} // _net_Conn is an interface wrapper for Conn type type _net_Conn struct { + IValue interface{} WClose func() error WLocalAddr func() net.Addr WRead func(b []byte) (n int, err error) @@ -146,39 +158,70 @@ type _net_Conn struct { WWrite func(b []byte) (n int, err error) } -func (W _net_Conn) Close() error { return W.WClose() } -func (W _net_Conn) LocalAddr() net.Addr { return W.WLocalAddr() } -func (W _net_Conn) Read(b []byte) (n int, err error) { return W.WRead(b) } -func (W _net_Conn) RemoteAddr() net.Addr { return W.WRemoteAddr() } -func (W _net_Conn) SetDeadline(t time.Time) error { return W.WSetDeadline(t) } -func (W _net_Conn) SetReadDeadline(t time.Time) error { return W.WSetReadDeadline(t) } -func (W _net_Conn) SetWriteDeadline(t time.Time) error { return W.WSetWriteDeadline(t) } -func (W _net_Conn) Write(b []byte) (n int, err error) { return W.WWrite(b) } +func (W _net_Conn) Close() error { + return W.WClose() +} +func (W _net_Conn) LocalAddr() net.Addr { + return W.WLocalAddr() +} +func (W _net_Conn) Read(b []byte) (n int, err error) { + return W.WRead(b) +} +func (W _net_Conn) RemoteAddr() net.Addr { + return W.WRemoteAddr() +} +func (W _net_Conn) SetDeadline(t time.Time) error { + return W.WSetDeadline(t) +} +func (W _net_Conn) SetReadDeadline(t time.Time) error { + return W.WSetReadDeadline(t) +} +func (W _net_Conn) SetWriteDeadline(t time.Time) error { + return W.WSetWriteDeadline(t) +} +func (W _net_Conn) Write(b []byte) (n int, err error) { + return W.WWrite(b) +} // _net_Error is an interface wrapper for Error type type _net_Error struct { + IValue interface{} WError func() string WTemporary func() bool WTimeout func() bool } -func (W _net_Error) Error() string { return W.WError() } -func (W _net_Error) Temporary() bool { return W.WTemporary() } -func (W _net_Error) Timeout() bool { return W.WTimeout() } +func (W _net_Error) Error() string { + return W.WError() +} +func (W _net_Error) Temporary() bool { + return W.WTemporary() +} +func (W _net_Error) Timeout() bool { + return W.WTimeout() +} // _net_Listener is an interface wrapper for Listener type type _net_Listener struct { + IValue interface{} WAccept func() (net.Conn, error) WAddr func() net.Addr WClose func() error } -func (W _net_Listener) Accept() (net.Conn, error) { return W.WAccept() } -func (W _net_Listener) Addr() net.Addr { return W.WAddr() } -func (W _net_Listener) Close() error { return W.WClose() } +func (W _net_Listener) Accept() (net.Conn, error) { + return W.WAccept() +} +func (W _net_Listener) Addr() net.Addr { + return W.WAddr() +} +func (W _net_Listener) Close() error { + return W.WClose() +} // _net_PacketConn is an interface wrapper for PacketConn type type _net_PacketConn struct { + IValue interface{} WClose func() error WLocalAddr func() net.Addr WReadFrom func(p []byte) (n int, addr net.Addr, err error) @@ -188,12 +231,24 @@ type _net_PacketConn struct { WWriteTo func(p []byte, addr net.Addr) (n int, err error) } -func (W _net_PacketConn) Close() error { return W.WClose() } -func (W _net_PacketConn) LocalAddr() net.Addr { return W.WLocalAddr() } -func (W _net_PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { return W.WReadFrom(p) } -func (W _net_PacketConn) SetDeadline(t time.Time) error { return W.WSetDeadline(t) } -func (W _net_PacketConn) SetReadDeadline(t time.Time) error { return W.WSetReadDeadline(t) } -func (W _net_PacketConn) SetWriteDeadline(t time.Time) error { return W.WSetWriteDeadline(t) } +func (W _net_PacketConn) Close() error { + return W.WClose() +} +func (W _net_PacketConn) LocalAddr() net.Addr { + return W.WLocalAddr() +} +func (W _net_PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { + return W.WReadFrom(p) +} +func (W _net_PacketConn) SetDeadline(t time.Time) error { + return W.WSetDeadline(t) +} +func (W _net_PacketConn) SetReadDeadline(t time.Time) error { + return W.WSetReadDeadline(t) +} +func (W _net_PacketConn) SetWriteDeadline(t time.Time) error { + return W.WSetWriteDeadline(t) +} func (W _net_PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { return W.WWriteTo(p, addr) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http.go index 3693127..5e0fcc7 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -8,16 +9,17 @@ import ( "bufio" "go/constant" "go/token" + "io/fs" "net" "net/http" "net/url" - "os" "reflect" ) func init() { - Symbols["net/http"] = map[string]reflect.Value{ + Symbols["net/http/http"] = map[string]reflect.Value{ // function, constant and variable definitions + "AllowQuerySemicolons": reflect.ValueOf(http.AllowQuerySemicolons), "CanonicalHeaderKey": reflect.ValueOf(http.CanonicalHeaderKey), "DefaultClient": reflect.ValueOf(&http.DefaultClient).Elem(), "DefaultMaxHeaderBytes": reflect.ValueOf(constant.MakeFromLiteral("1048576", token.INT, 0)), @@ -47,6 +49,7 @@ func init() { "ErrUseLastResponse": reflect.ValueOf(&http.ErrUseLastResponse).Elem(), "ErrWriteAfterFlush": reflect.ValueOf(&http.ErrWriteAfterFlush).Elem(), "Error": reflect.ValueOf(http.Error), + "FS": reflect.ValueOf(http.FS), "FileServer": reflect.ValueOf(http.FileServer), "Get": reflect.ValueOf(http.Get), "Handle": reflect.ValueOf(http.Handle), @@ -55,6 +58,7 @@ func init() { "ListenAndServe": reflect.ValueOf(http.ListenAndServe), "ListenAndServeTLS": reflect.ValueOf(http.ListenAndServeTLS), "LocalAddrContextKey": reflect.ValueOf(&http.LocalAddrContextKey).Elem(), + "MaxBytesHandler": reflect.ValueOf(http.MaxBytesHandler), "MaxBytesReader": reflect.ValueOf(http.MaxBytesReader), "MethodConnect": reflect.ValueOf(constant.MakeFromLiteral("\"CONNECT\"", token.STRING, 0)), "MethodDelete": reflect.ValueOf(constant.MakeFromLiteral("\"DELETE\"", token.STRING, 0)), @@ -179,6 +183,7 @@ func init() { "HandlerFunc": reflect.ValueOf((*http.HandlerFunc)(nil)), "Header": reflect.ValueOf((*http.Header)(nil)), "Hijacker": reflect.ValueOf((*http.Hijacker)(nil)), + "MaxBytesError": reflect.ValueOf((*http.MaxBytesError)(nil)), "ProtocolError": reflect.ValueOf((*http.ProtocolError)(nil)), "PushOptions": reflect.ValueOf((*http.PushOptions)(nil)), "Pusher": reflect.ValueOf((*http.Pusher)(nil)), @@ -207,68 +212,98 @@ func init() { // _net_http_CloseNotifier is an interface wrapper for CloseNotifier type type _net_http_CloseNotifier struct { + IValue interface{} WCloseNotify func() <-chan bool } -func (W _net_http_CloseNotifier) CloseNotify() <-chan bool { return W.WCloseNotify() } +func (W _net_http_CloseNotifier) CloseNotify() <-chan bool { + return W.WCloseNotify() +} // _net_http_CookieJar is an interface wrapper for CookieJar type type _net_http_CookieJar struct { + IValue interface{} WCookies func(u *url.URL) []*http.Cookie WSetCookies func(u *url.URL, cookies []*http.Cookie) } -func (W _net_http_CookieJar) Cookies(u *url.URL) []*http.Cookie { return W.WCookies(u) } +func (W _net_http_CookieJar) Cookies(u *url.URL) []*http.Cookie { + return W.WCookies(u) +} func (W _net_http_CookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) { W.WSetCookies(u, cookies) } // _net_http_File is an interface wrapper for File type type _net_http_File struct { + IValue interface{} WClose func() error WRead func(p []byte) (n int, err error) - WReaddir func(count int) ([]os.FileInfo, error) + WReaddir func(count int) ([]fs.FileInfo, error) WSeek func(offset int64, whence int) (int64, error) - WStat func() (os.FileInfo, error) + WStat func() (fs.FileInfo, error) } -func (W _net_http_File) Close() error { return W.WClose() } -func (W _net_http_File) Read(p []byte) (n int, err error) { return W.WRead(p) } -func (W _net_http_File) Readdir(count int) ([]os.FileInfo, error) { return W.WReaddir(count) } -func (W _net_http_File) Seek(offset int64, whence int) (int64, error) { return W.WSeek(offset, whence) } -func (W _net_http_File) Stat() (os.FileInfo, error) { return W.WStat() } +func (W _net_http_File) Close() error { + return W.WClose() +} +func (W _net_http_File) Read(p []byte) (n int, err error) { + return W.WRead(p) +} +func (W _net_http_File) Readdir(count int) ([]fs.FileInfo, error) { + return W.WReaddir(count) +} +func (W _net_http_File) Seek(offset int64, whence int) (int64, error) { + return W.WSeek(offset, whence) +} +func (W _net_http_File) Stat() (fs.FileInfo, error) { + return W.WStat() +} // _net_http_FileSystem is an interface wrapper for FileSystem type type _net_http_FileSystem struct { - WOpen func(name string) (http.File, error) + IValue interface{} + WOpen func(name string) (http.File, error) } -func (W _net_http_FileSystem) Open(name string) (http.File, error) { return W.WOpen(name) } +func (W _net_http_FileSystem) Open(name string) (http.File, error) { + return W.WOpen(name) +} // _net_http_Flusher is an interface wrapper for Flusher type type _net_http_Flusher struct { + IValue interface{} WFlush func() } -func (W _net_http_Flusher) Flush() { W.WFlush() } +func (W _net_http_Flusher) Flush() { + W.WFlush() +} // _net_http_Handler is an interface wrapper for Handler type type _net_http_Handler struct { + IValue interface{} WServeHTTP func(a0 http.ResponseWriter, a1 *http.Request) } -func (W _net_http_Handler) ServeHTTP(a0 http.ResponseWriter, a1 *http.Request) { W.WServeHTTP(a0, a1) } +func (W _net_http_Handler) ServeHTTP(a0 http.ResponseWriter, a1 *http.Request) { + W.WServeHTTP(a0, a1) +} // _net_http_Hijacker is an interface wrapper for Hijacker type type _net_http_Hijacker struct { + IValue interface{} WHijack func() (net.Conn, *bufio.ReadWriter, error) } -func (W _net_http_Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { return W.WHijack() } +func (W _net_http_Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return W.WHijack() +} // _net_http_Pusher is an interface wrapper for Pusher type type _net_http_Pusher struct { - WPush func(target string, opts *http.PushOptions) error + IValue interface{} + WPush func(target string, opts *http.PushOptions) error } func (W _net_http_Pusher) Push(target string, opts *http.PushOptions) error { @@ -277,17 +312,25 @@ func (W _net_http_Pusher) Push(target string, opts *http.PushOptions) error { // _net_http_ResponseWriter is an interface wrapper for ResponseWriter type type _net_http_ResponseWriter struct { + IValue interface{} WHeader func() http.Header WWrite func(a0 []byte) (int, error) WWriteHeader func(statusCode int) } -func (W _net_http_ResponseWriter) Header() http.Header { return W.WHeader() } -func (W _net_http_ResponseWriter) Write(a0 []byte) (int, error) { return W.WWrite(a0) } -func (W _net_http_ResponseWriter) WriteHeader(statusCode int) { W.WWriteHeader(statusCode) } +func (W _net_http_ResponseWriter) Header() http.Header { + return W.WHeader() +} +func (W _net_http_ResponseWriter) Write(a0 []byte) (int, error) { + return W.WWrite(a0) +} +func (W _net_http_ResponseWriter) WriteHeader(statusCode int) { + W.WWriteHeader(statusCode) +} // _net_http_RoundTripper is an interface wrapper for RoundTripper type type _net_http_RoundTripper struct { + IValue interface{} WRoundTrip func(a0 *http.Request) (*http.Response, error) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cgi.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cgi.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cgi.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cgi.go index 7a3d63d..6e1d231 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_cgi.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cgi.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/cgi'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/cgi"] = map[string]reflect.Value{ + Symbols["net/http/cgi/cgi"] = map[string]reflect.Value{ // function, constant and variable definitions "Request": reflect.ValueOf(cgi.Request), "RequestFromMap": reflect.ValueOf(cgi.RequestFromMap), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cookiejar.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cookiejar.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cookiejar.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cookiejar.go index cd659fa..94fb01c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_cookiejar.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_cookiejar.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/cookiejar'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/cookiejar"] = map[string]reflect.Value{ + Symbols["net/http/cookiejar/cookiejar"] = map[string]reflect.Value{ // function, constant and variable definitions "New": reflect.ValueOf(cookiejar.New), @@ -26,6 +27,7 @@ func init() { // _net_http_cookiejar_PublicSuffixList is an interface wrapper for PublicSuffixList type type _net_http_cookiejar_PublicSuffixList struct { + IValue interface{} WPublicSuffix func(domain string) string WString func() string } @@ -33,4 +35,9 @@ type _net_http_cookiejar_PublicSuffixList struct { func (W _net_http_cookiejar_PublicSuffixList) PublicSuffix(domain string) string { return W.WPublicSuffix(domain) } -func (W _net_http_cookiejar_PublicSuffixList) String() string { return W.WString() } +func (W _net_http_cookiejar_PublicSuffixList) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_fcgi.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_fcgi.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_fcgi.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_fcgi.go index 62dc7ec..34c8951 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_fcgi.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_fcgi.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/fcgi'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/fcgi"] = map[string]reflect.Value{ + Symbols["net/http/fcgi/fcgi"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrConnClosed": reflect.ValueOf(&fcgi.ErrConnClosed).Elem(), "ErrRequestAborted": reflect.ValueOf(&fcgi.ErrRequestAborted).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptest.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptest.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptest.go index c145d6e..ec603d1 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptest.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptest.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httptest'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["net/http/httptest"] = map[string]reflect.Value{ + Symbols["net/http/httptest/httptest"] = map[string]reflect.Value{ // function, constant and variable definitions "DefaultRemoteAddr": reflect.ValueOf(constant.MakeFromLiteral("\"1.2.3.4\"", token.STRING, 0)), "NewRecorder": reflect.ValueOf(httptest.NewRecorder), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptrace.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptrace.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptrace.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptrace.go index 7241609..26fcc6e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_http_httptrace.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httptrace.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httptrace'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/httptrace"] = map[string]reflect.Value{ + Symbols["net/http/httptrace/httptrace"] = map[string]reflect.Value{ // function, constant and variable definitions "ContextClientTrace": reflect.ValueOf(httptrace.ContextClientTrace), "WithClientTrace": reflect.ValueOf(httptrace.WithClientTrace), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httputil.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httputil.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httputil.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httputil.go index 4b638d3..d3d5cb6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_httputil.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_httputil.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/httputil'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/httputil"] = map[string]reflect.Value{ + Symbols["net/http/httputil/httputil"] = map[string]reflect.Value{ // function, constant and variable definitions "DumpRequest": reflect.ValueOf(httputil.DumpRequest), "DumpRequestOut": reflect.ValueOf(httputil.DumpRequestOut), @@ -39,9 +40,14 @@ func init() { // _net_http_httputil_BufferPool is an interface wrapper for BufferPool type type _net_http_httputil_BufferPool struct { - WGet func() []byte - WPut func(a0 []byte) + IValue interface{} + WGet func() []byte + WPut func(a0 []byte) } -func (W _net_http_httputil_BufferPool) Get() []byte { return W.WGet() } -func (W _net_http_httputil_BufferPool) Put(a0 []byte) { W.WPut(a0) } +func (W _net_http_httputil_BufferPool) Get() []byte { + return W.WGet() +} +func (W _net_http_httputil_BufferPool) Put(a0 []byte) { + W.WPut(a0) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_pprof.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_pprof.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_pprof.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_pprof.go index ec88495..f8db3ab 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_http_pprof.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_http_pprof.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/http/pprof'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/http/pprof"] = map[string]reflect.Value{ + Symbols["net/http/pprof/pprof"] = map[string]reflect.Value{ // function, constant and variable definitions "Cmdline": reflect.ValueOf(pprof.Cmdline), "Handler": reflect.ValueOf(pprof.Handler), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_mail.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_mail.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_mail.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_mail.go index 85322ee..e25b8d3 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_mail.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_mail.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/mail'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/mail"] = map[string]reflect.Value{ + Symbols["net/mail/mail"] = map[string]reflect.Value{ // function, constant and variable definitions "ErrHeaderNotPresent": reflect.ValueOf(&mail.ErrHeaderNotPresent).Elem(), "ParseAddress": reflect.ValueOf(mail.ParseAddress), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_netip.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_netip.go new file mode 100644 index 0000000..ceaf1ad --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_netip.go @@ -0,0 +1,36 @@ +// Code generated by 'yaegi extract net/netip'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "net/netip" + "reflect" +) + +func init() { + Symbols["net/netip/netip"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AddrFrom16": reflect.ValueOf(netip.AddrFrom16), + "AddrFrom4": reflect.ValueOf(netip.AddrFrom4), + "AddrFromSlice": reflect.ValueOf(netip.AddrFromSlice), + "AddrPortFrom": reflect.ValueOf(netip.AddrPortFrom), + "IPv4Unspecified": reflect.ValueOf(netip.IPv4Unspecified), + "IPv6LinkLocalAllNodes": reflect.ValueOf(netip.IPv6LinkLocalAllNodes), + "IPv6Unspecified": reflect.ValueOf(netip.IPv6Unspecified), + "MustParseAddr": reflect.ValueOf(netip.MustParseAddr), + "MustParseAddrPort": reflect.ValueOf(netip.MustParseAddrPort), + "MustParsePrefix": reflect.ValueOf(netip.MustParsePrefix), + "ParseAddr": reflect.ValueOf(netip.ParseAddr), + "ParseAddrPort": reflect.ValueOf(netip.ParseAddrPort), + "ParsePrefix": reflect.ValueOf(netip.ParsePrefix), + "PrefixFrom": reflect.ValueOf(netip.PrefixFrom), + + // type definitions + "Addr": reflect.ValueOf((*netip.Addr)(nil)), + "AddrPort": reflect.ValueOf((*netip.AddrPort)(nil)), + "Prefix": reflect.ValueOf((*netip.Prefix)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc.go similarity index 77% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc.go index e79e45c..394713f 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/rpc'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["net/rpc"] = map[string]reflect.Value{ + Symbols["net/rpc/rpc"] = map[string]reflect.Value{ // function, constant and variable definitions "Accept": reflect.ValueOf(rpc.Accept), "DefaultDebugPath": reflect.ValueOf(constant.MakeFromLiteral("\"/debug/rpc\"", token.STRING, 0)), @@ -50,34 +51,44 @@ func init() { // _net_rpc_ClientCodec is an interface wrapper for ClientCodec type type _net_rpc_ClientCodec struct { + IValue interface{} WClose func() error - WReadResponseBody func(a0 interface{}) error + WReadResponseBody func(a0 any) error WReadResponseHeader func(a0 *rpc.Response) error - WWriteRequest func(a0 *rpc.Request, a1 interface{}) error + WWriteRequest func(a0 *rpc.Request, a1 any) error } -func (W _net_rpc_ClientCodec) Close() error { return W.WClose() } -func (W _net_rpc_ClientCodec) ReadResponseBody(a0 interface{}) error { return W.WReadResponseBody(a0) } +func (W _net_rpc_ClientCodec) Close() error { + return W.WClose() +} +func (W _net_rpc_ClientCodec) ReadResponseBody(a0 any) error { + return W.WReadResponseBody(a0) +} func (W _net_rpc_ClientCodec) ReadResponseHeader(a0 *rpc.Response) error { return W.WReadResponseHeader(a0) } -func (W _net_rpc_ClientCodec) WriteRequest(a0 *rpc.Request, a1 interface{}) error { +func (W _net_rpc_ClientCodec) WriteRequest(a0 *rpc.Request, a1 any) error { return W.WWriteRequest(a0, a1) } // _net_rpc_ServerCodec is an interface wrapper for ServerCodec type type _net_rpc_ServerCodec struct { + IValue interface{} WClose func() error - WReadRequestBody func(a0 interface{}) error + WReadRequestBody func(a0 any) error WReadRequestHeader func(a0 *rpc.Request) error - WWriteResponse func(a0 *rpc.Response, a1 interface{}) error + WWriteResponse func(a0 *rpc.Response, a1 any) error } -func (W _net_rpc_ServerCodec) Close() error { return W.WClose() } -func (W _net_rpc_ServerCodec) ReadRequestBody(a0 interface{}) error { return W.WReadRequestBody(a0) } +func (W _net_rpc_ServerCodec) Close() error { + return W.WClose() +} +func (W _net_rpc_ServerCodec) ReadRequestBody(a0 any) error { + return W.WReadRequestBody(a0) +} func (W _net_rpc_ServerCodec) ReadRequestHeader(a0 *rpc.Request) error { return W.WReadRequestHeader(a0) } -func (W _net_rpc_ServerCodec) WriteResponse(a0 *rpc.Response, a1 interface{}) error { +func (W _net_rpc_ServerCodec) WriteResponse(a0 *rpc.Response, a1 any) error { return W.WWriteResponse(a0, a1) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc_jsonrpc.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc_jsonrpc.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc_jsonrpc.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc_jsonrpc.go index 2159599..6eb7e1c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_rpc_jsonrpc.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_rpc_jsonrpc.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/rpc/jsonrpc'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/rpc/jsonrpc"] = map[string]reflect.Value{ + Symbols["net/rpc/jsonrpc/jsonrpc"] = map[string]reflect.Value{ // function, constant and variable definitions "Dial": reflect.ValueOf(jsonrpc.Dial), "NewClient": reflect.ValueOf(jsonrpc.NewClient), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_smtp.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_smtp.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_smtp.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_smtp.go index cc1b7cc..41fb884 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_smtp.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_smtp.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/smtp'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/smtp"] = map[string]reflect.Value{ + Symbols["net/smtp/smtp"] = map[string]reflect.Value{ // function, constant and variable definitions "CRAMMD5Auth": reflect.ValueOf(smtp.CRAMMD5Auth), "Dial": reflect.ValueOf(smtp.Dial), @@ -30,6 +31,7 @@ func init() { // _net_smtp_Auth is an interface wrapper for Auth type type _net_smtp_Auth struct { + IValue interface{} WNext func(fromServer []byte, more bool) (toServer []byte, err error) WStart func(server *smtp.ServerInfo) (proto string, toServer []byte, err error) } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_textproto.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_textproto.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_net_textproto.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_textproto.go index 507e4a0..870a6e8 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_net_textproto.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_textproto.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/textproto'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["net/textproto"] = map[string]reflect.Value{ + Symbols["net/textproto/textproto"] = map[string]reflect.Value{ // function, constant and variable definitions "CanonicalMIMEHeaderKey": reflect.ValueOf(textproto.CanonicalMIMEHeaderKey), "Dial": reflect.ValueOf(textproto.Dial), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_url.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_url.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_net_url.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_net_url.go index f815079..06e8df8 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_net_url.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_net_url.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract net/url'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,8 +11,9 @@ import ( ) func init() { - Symbols["net/url"] = map[string]reflect.Value{ + Symbols["net/url/url"] = map[string]reflect.Value{ // function, constant and variable definitions + "JoinPath": reflect.ValueOf(url.JoinPath), "Parse": reflect.ValueOf(url.Parse), "ParseQuery": reflect.ValueOf(url.ParseQuery), "ParseRequestURI": reflect.ValueOf(url.ParseRequestURI), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_os.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_os.go index cb9acdf..ddac452 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract os'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -14,7 +15,7 @@ import ( ) func init() { - Symbols["os"] = map[string]reflect.Value{ + Symbols["os/os"] = map[string]reflect.Value{ // function, constant and variable definitions "Args": reflect.ValueOf(&os.Args).Elem(), "Chdir": reflect.ValueOf(os.Chdir), @@ -142,39 +143,69 @@ func init() { // _os_DirEntry is an interface wrapper for DirEntry type type _os_DirEntry struct { + IValue interface{} WInfo func() (fs.FileInfo, error) WIsDir func() bool WName func() string WType func() fs.FileMode } -func (W _os_DirEntry) Info() (fs.FileInfo, error) { return W.WInfo() } -func (W _os_DirEntry) IsDir() bool { return W.WIsDir() } -func (W _os_DirEntry) Name() string { return W.WName() } -func (W _os_DirEntry) Type() fs.FileMode { return W.WType() } +func (W _os_DirEntry) Info() (fs.FileInfo, error) { + return W.WInfo() +} +func (W _os_DirEntry) IsDir() bool { + return W.WIsDir() +} +func (W _os_DirEntry) Name() string { + return W.WName() +} +func (W _os_DirEntry) Type() fs.FileMode { + return W.WType() +} // _os_FileInfo is an interface wrapper for FileInfo type type _os_FileInfo struct { + IValue interface{} WIsDir func() bool WModTime func() time.Time WMode func() fs.FileMode WName func() string WSize func() int64 - WSys func() interface{} + WSys func() any } -func (W _os_FileInfo) IsDir() bool { return W.WIsDir() } -func (W _os_FileInfo) ModTime() time.Time { return W.WModTime() } -func (W _os_FileInfo) Mode() fs.FileMode { return W.WMode() } -func (W _os_FileInfo) Name() string { return W.WName() } -func (W _os_FileInfo) Size() int64 { return W.WSize() } -func (W _os_FileInfo) Sys() interface{} { return W.WSys() } +func (W _os_FileInfo) IsDir() bool { + return W.WIsDir() +} +func (W _os_FileInfo) ModTime() time.Time { + return W.WModTime() +} +func (W _os_FileInfo) Mode() fs.FileMode { + return W.WMode() +} +func (W _os_FileInfo) Name() string { + return W.WName() +} +func (W _os_FileInfo) Size() int64 { + return W.WSize() +} +func (W _os_FileInfo) Sys() any { + return W.WSys() +} // _os_Signal is an interface wrapper for Signal type type _os_Signal struct { + IValue interface{} WSignal func() WString func() string } -func (W _os_Signal) Signal() { W.WSignal() } -func (W _os_Signal) String() string { return W.WString() } +func (W _os_Signal) Signal() { + W.WSignal() +} +func (W _os_Signal) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os_signal.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os_signal.go similarity index 84% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_os_signal.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_os_signal.go index 94b36ff..10de330 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_os_signal.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os_signal.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract os/signal'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["os/signal"] = map[string]reflect.Value{ + Symbols["os/signal/signal"] = map[string]reflect.Value{ // function, constant and variable definitions "Ignore": reflect.ValueOf(signal.Ignore), "Ignored": reflect.ValueOf(signal.Ignored), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os_user.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os_user.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_os_user.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_os_user.go index ce82db3..a9997d2 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_os_user.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_os_user.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract os/user'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["os/user"] = map[string]reflect.Value{ + Symbols["os/user/user"] = map[string]reflect.Value{ // function, constant and variable definitions "Current": reflect.ValueOf(user.Current), "Lookup": reflect.ValueOf(user.Lookup), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_path.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_path.go similarity index 87% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_path.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_path.go index e61ebbe..c2d84ac 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_path.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_path.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract path'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["path"] = map[string]reflect.Value{ + Symbols["path/path"] = map[string]reflect.Value{ // function, constant and variable definitions "Base": reflect.ValueOf(path.Base), "Clean": reflect.ValueOf(path.Clean), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_path_filepath.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_path_filepath.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_path_filepath.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_path_filepath.go index a274377..bf5afc4 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_path_filepath.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_path_filepath.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract path/filepath'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["path/filepath"] = map[string]reflect.Value{ + Symbols["path/filepath/filepath"] = map[string]reflect.Value{ // function, constant and variable definitions "Abs": reflect.ValueOf(filepath.Abs), "Base": reflect.ValueOf(filepath.Base), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_reflect.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_reflect.go similarity index 69% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_reflect.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_reflect.go index 47f4c23..1966443 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_reflect.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_reflect.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract reflect'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -9,7 +10,7 @@ import ( ) func init() { - Symbols["reflect"] = map[string]reflect.Value{ + Symbols["reflect/reflect"] = map[string]reflect.Value{ // function, constant and variable definitions "Append": reflect.ValueOf(reflect.Append), "AppendSlice": reflect.ValueOf(reflect.AppendSlice), @@ -44,6 +45,8 @@ func init() { "MapOf": reflect.ValueOf(reflect.MapOf), "New": reflect.ValueOf(reflect.New), "NewAt": reflect.ValueOf(reflect.NewAt), + "Pointer": reflect.ValueOf(reflect.Pointer), + "PointerTo": reflect.ValueOf(reflect.PointerTo), "Ptr": reflect.ValueOf(reflect.Ptr), "PtrTo": reflect.ValueOf(reflect.PtrTo), "RecvDir": reflect.ValueOf(reflect.RecvDir), @@ -67,6 +70,7 @@ func init() { "Uintptr": reflect.ValueOf(reflect.Uintptr), "UnsafePointer": reflect.ValueOf(reflect.UnsafePointer), "ValueOf": reflect.ValueOf(reflect.ValueOf), + "VisibleFields": reflect.ValueOf(reflect.VisibleFields), "Zero": reflect.ValueOf(reflect.Zero), // type definitions @@ -91,6 +95,7 @@ func init() { // _reflect_Type is an interface wrapper for Type type type _reflect_Type struct { + IValue interface{} WAlign func() int WAssignableTo func(u reflect.Type) bool WBits func() int @@ -122,36 +127,93 @@ type _reflect_Type struct { WString func() string } -func (W _reflect_Type) Align() int { return W.WAlign() } -func (W _reflect_Type) AssignableTo(u reflect.Type) bool { return W.WAssignableTo(u) } -func (W _reflect_Type) Bits() int { return W.WBits() } -func (W _reflect_Type) ChanDir() reflect.ChanDir { return W.WChanDir() } -func (W _reflect_Type) Comparable() bool { return W.WComparable() } -func (W _reflect_Type) ConvertibleTo(u reflect.Type) bool { return W.WConvertibleTo(u) } -func (W _reflect_Type) Elem() reflect.Type { return W.WElem() } -func (W _reflect_Type) Field(i int) reflect.StructField { return W.WField(i) } -func (W _reflect_Type) FieldAlign() int { return W.WFieldAlign() } -func (W _reflect_Type) FieldByIndex(index []int) reflect.StructField { return W.WFieldByIndex(index) } +func (W _reflect_Type) Align() int { + return W.WAlign() +} +func (W _reflect_Type) AssignableTo(u reflect.Type) bool { + return W.WAssignableTo(u) +} +func (W _reflect_Type) Bits() int { + return W.WBits() +} +func (W _reflect_Type) ChanDir() reflect.ChanDir { + return W.WChanDir() +} +func (W _reflect_Type) Comparable() bool { + return W.WComparable() +} +func (W _reflect_Type) ConvertibleTo(u reflect.Type) bool { + return W.WConvertibleTo(u) +} +func (W _reflect_Type) Elem() reflect.Type { + return W.WElem() +} +func (W _reflect_Type) Field(i int) reflect.StructField { + return W.WField(i) +} +func (W _reflect_Type) FieldAlign() int { + return W.WFieldAlign() +} +func (W _reflect_Type) FieldByIndex(index []int) reflect.StructField { + return W.WFieldByIndex(index) +} func (W _reflect_Type) FieldByName(name string) (reflect.StructField, bool) { return W.WFieldByName(name) } func (W _reflect_Type) FieldByNameFunc(match func(string) bool) (reflect.StructField, bool) { return W.WFieldByNameFunc(match) } -func (W _reflect_Type) Implements(u reflect.Type) bool { return W.WImplements(u) } -func (W _reflect_Type) In(i int) reflect.Type { return W.WIn(i) } -func (W _reflect_Type) IsVariadic() bool { return W.WIsVariadic() } -func (W _reflect_Type) Key() reflect.Type { return W.WKey() } -func (W _reflect_Type) Kind() reflect.Kind { return W.WKind() } -func (W _reflect_Type) Len() int { return W.WLen() } -func (W _reflect_Type) Method(a0 int) reflect.Method { return W.WMethod(a0) } -func (W _reflect_Type) MethodByName(a0 string) (reflect.Method, bool) { return W.WMethodByName(a0) } -func (W _reflect_Type) Name() string { return W.WName() } -func (W _reflect_Type) NumField() int { return W.WNumField() } -func (W _reflect_Type) NumIn() int { return W.WNumIn() } -func (W _reflect_Type) NumMethod() int { return W.WNumMethod() } -func (W _reflect_Type) NumOut() int { return W.WNumOut() } -func (W _reflect_Type) Out(i int) reflect.Type { return W.WOut(i) } -func (W _reflect_Type) PkgPath() string { return W.WPkgPath() } -func (W _reflect_Type) Size() uintptr { return W.WSize() } -func (W _reflect_Type) String() string { return W.WString() } +func (W _reflect_Type) Implements(u reflect.Type) bool { + return W.WImplements(u) +} +func (W _reflect_Type) In(i int) reflect.Type { + return W.WIn(i) +} +func (W _reflect_Type) IsVariadic() bool { + return W.WIsVariadic() +} +func (W _reflect_Type) Key() reflect.Type { + return W.WKey() +} +func (W _reflect_Type) Kind() reflect.Kind { + return W.WKind() +} +func (W _reflect_Type) Len() int { + return W.WLen() +} +func (W _reflect_Type) Method(a0 int) reflect.Method { + return W.WMethod(a0) +} +func (W _reflect_Type) MethodByName(a0 string) (reflect.Method, bool) { + return W.WMethodByName(a0) +} +func (W _reflect_Type) Name() string { + return W.WName() +} +func (W _reflect_Type) NumField() int { + return W.WNumField() +} +func (W _reflect_Type) NumIn() int { + return W.WNumIn() +} +func (W _reflect_Type) NumMethod() int { + return W.WNumMethod() +} +func (W _reflect_Type) NumOut() int { + return W.WNumOut() +} +func (W _reflect_Type) Out(i int) reflect.Type { + return W.WOut(i) +} +func (W _reflect_Type) PkgPath() string { + return W.WPkgPath() +} +func (W _reflect_Type) Size() uintptr { + return W.WSize() +} +func (W _reflect_Type) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp.go index 23955e2..948147d 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract regexp'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["regexp"] = map[string]reflect.Value{ + Symbols["regexp/regexp"] = map[string]reflect.Value{ // function, constant and variable definitions "Compile": reflect.ValueOf(regexp.Compile), "CompilePOSIX": reflect.ValueOf(regexp.CompilePOSIX), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp_syntax.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp_syntax.go similarity index 96% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp_syntax.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp_syntax.go index f66fe08..392c7eb 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_regexp_syntax.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_regexp_syntax.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract regexp/syntax'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["regexp/syntax"] = map[string]reflect.Value{ + Symbols["regexp/syntax/syntax"] = map[string]reflect.Value{ // function, constant and variable definitions "ClassNL": reflect.ValueOf(syntax.ClassNL), "Compile": reflect.ValueOf(syntax.Compile), @@ -34,6 +35,7 @@ func init() { "ErrMissingBracket": reflect.ValueOf(syntax.ErrMissingBracket), "ErrMissingParen": reflect.ValueOf(syntax.ErrMissingParen), "ErrMissingRepeatArgument": reflect.ValueOf(syntax.ErrMissingRepeatArgument), + "ErrNestingDepth": reflect.ValueOf(syntax.ErrNestingDepth), "ErrTrailingBackslash": reflect.ValueOf(syntax.ErrTrailingBackslash), "ErrUnexpectedParen": reflect.ValueOf(syntax.ErrUnexpectedParen), "FoldCase": reflect.ValueOf(syntax.FoldCase), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime.go index 564ff30..9820ba9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_runtime.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["runtime"] = map[string]reflect.Value{ + Symbols["runtime/runtime"] = map[string]reflect.Value{ // function, constant and variable definitions "BlockProfile": reflect.ValueOf(runtime.BlockProfile), "Breakpoint": reflect.ValueOf(runtime.Breakpoint), @@ -70,9 +71,14 @@ func init() { // _runtime_Error is an interface wrapper for Error type type _runtime_Error struct { + IValue interface{} WError func() string WRuntimeError func() } -func (W _runtime_Error) Error() string { return W.WError() } -func (W _runtime_Error) RuntimeError() { W.WRuntimeError() } +func (W _runtime_Error) Error() string { + return W.WError() +} +func (W _runtime_Error) RuntimeError() { + W.WRuntimeError() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_debug.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_debug.go similarity index 65% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_debug.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_debug.go index 398dd6a..177722c 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_debug.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_debug.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/debug'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,23 +11,26 @@ import ( ) func init() { - Symbols["runtime/debug"] = map[string]reflect.Value{ + Symbols["runtime/debug/debug"] = map[string]reflect.Value{ // function, constant and variable definitions "FreeOSMemory": reflect.ValueOf(debug.FreeOSMemory), + "ParseBuildInfo": reflect.ValueOf(debug.ParseBuildInfo), "PrintStack": reflect.ValueOf(debug.PrintStack), "ReadBuildInfo": reflect.ValueOf(debug.ReadBuildInfo), "ReadGCStats": reflect.ValueOf(debug.ReadGCStats), "SetGCPercent": reflect.ValueOf(debug.SetGCPercent), "SetMaxStack": reflect.ValueOf(debug.SetMaxStack), "SetMaxThreads": reflect.ValueOf(debug.SetMaxThreads), + "SetMemoryLimit": reflect.ValueOf(debug.SetMemoryLimit), "SetPanicOnFault": reflect.ValueOf(debug.SetPanicOnFault), "SetTraceback": reflect.ValueOf(debug.SetTraceback), "Stack": reflect.ValueOf(debug.Stack), "WriteHeapDump": reflect.ValueOf(debug.WriteHeapDump), // type definitions - "BuildInfo": reflect.ValueOf((*debug.BuildInfo)(nil)), - "GCStats": reflect.ValueOf((*debug.GCStats)(nil)), - "Module": reflect.ValueOf((*debug.Module)(nil)), + "BuildInfo": reflect.ValueOf((*debug.BuildInfo)(nil)), + "BuildSetting": reflect.ValueOf((*debug.BuildSetting)(nil)), + "GCStats": reflect.ValueOf((*debug.GCStats)(nil)), + "Module": reflect.ValueOf((*debug.Module)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_metrics.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_metrics.go new file mode 100644 index 0000000..8dd281c --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_metrics.go @@ -0,0 +1,30 @@ +// Code generated by 'yaegi extract runtime/metrics'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "reflect" + "runtime/metrics" +) + +func init() { + Symbols["runtime/metrics/metrics"] = map[string]reflect.Value{ + // function, constant and variable definitions + "All": reflect.ValueOf(metrics.All), + "KindBad": reflect.ValueOf(metrics.KindBad), + "KindFloat64": reflect.ValueOf(metrics.KindFloat64), + "KindFloat64Histogram": reflect.ValueOf(metrics.KindFloat64Histogram), + "KindUint64": reflect.ValueOf(metrics.KindUint64), + "Read": reflect.ValueOf(metrics.Read), + + // type definitions + "Description": reflect.ValueOf((*metrics.Description)(nil)), + "Float64Histogram": reflect.ValueOf((*metrics.Float64Histogram)(nil)), + "Sample": reflect.ValueOf((*metrics.Sample)(nil)), + "Value": reflect.ValueOf((*metrics.Value)(nil)), + "ValueKind": reflect.ValueOf((*metrics.ValueKind)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_pprof.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_pprof.go similarity index 91% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_pprof.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_pprof.go index e20a82a..1f2c1fc 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_pprof.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_pprof.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/pprof'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["runtime/pprof"] = map[string]reflect.Value{ + Symbols["runtime/pprof/pprof"] = map[string]reflect.Value{ // function, constant and variable definitions "Do": reflect.ValueOf(pprof.Do), "ForLabels": reflect.ValueOf(pprof.ForLabels), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_trace.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_trace.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_trace.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_trace.go index 78e82d5..1111ced 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_runtime_trace.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_runtime_trace.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract runtime/trace'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["runtime/trace"] = map[string]reflect.Value{ + Symbols["runtime/trace/trace"] = map[string]reflect.Value{ // function, constant and variable definitions "IsEnabled": reflect.ValueOf(trace.IsEnabled), "Log": reflect.ValueOf(trace.Log), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sort.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sort.go similarity index 78% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_sort.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_sort.go index 02cd095..444619e 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sort.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sort.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sort'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,8 +11,9 @@ import ( ) func init() { - Symbols["sort"] = map[string]reflect.Value{ + Symbols["sort/sort"] = map[string]reflect.Value{ // function, constant and variable definitions + "Find": reflect.ValueOf(sort.Find), "Float64s": reflect.ValueOf(sort.Float64s), "Float64sAreSorted": reflect.ValueOf(sort.Float64sAreSorted), "Ints": reflect.ValueOf(sort.Ints), @@ -43,11 +45,18 @@ func init() { // _sort_Interface is an interface wrapper for Interface type type _sort_Interface struct { - WLen func() int - WLess func(i int, j int) bool - WSwap func(i int, j int) + IValue interface{} + WLen func() int + WLess func(i int, j int) bool + WSwap func(i int, j int) } -func (W _sort_Interface) Len() int { return W.WLen() } -func (W _sort_Interface) Less(i int, j int) bool { return W.WLess(i, j) } -func (W _sort_Interface) Swap(i int, j int) { W.WSwap(i, j) } +func (W _sort_Interface) Len() int { + return W.WLen() +} +func (W _sort_Interface) Less(i int, j int) bool { + return W.WLess(i, j) +} +func (W _sort_Interface) Swap(i int, j int) { + W.WSwap(i, j) +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_strconv.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_strconv.go similarity index 94% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_strconv.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_strconv.go index 94d1889..3a2e033 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_strconv.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_strconv.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract strconv'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["strconv"] = map[string]reflect.Value{ + Symbols["strconv/strconv"] = map[string]reflect.Value{ // function, constant and variable definitions "AppendBool": reflect.ValueOf(strconv.AppendBool), "AppendFloat": reflect.ValueOf(strconv.AppendFloat), @@ -48,6 +49,7 @@ func init() { "QuoteRuneToGraphic": reflect.ValueOf(strconv.QuoteRuneToGraphic), "QuoteToASCII": reflect.ValueOf(strconv.QuoteToASCII), "QuoteToGraphic": reflect.ValueOf(strconv.QuoteToGraphic), + "QuotedPrefix": reflect.ValueOf(strconv.QuotedPrefix), "Unquote": reflect.ValueOf(strconv.Unquote), "UnquoteChar": reflect.ValueOf(strconv.UnquoteChar), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_strings.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_strings.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_strings.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_strings.go index e3620ed..495d22a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_strings.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_strings.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract strings'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,13 +11,15 @@ import ( ) func init() { - Symbols["strings"] = map[string]reflect.Value{ + Symbols["strings/strings"] = map[string]reflect.Value{ // function, constant and variable definitions + "Clone": reflect.ValueOf(strings.Clone), "Compare": reflect.ValueOf(strings.Compare), "Contains": reflect.ValueOf(strings.Contains), "ContainsAny": reflect.ValueOf(strings.ContainsAny), "ContainsRune": reflect.ValueOf(strings.ContainsRune), "Count": reflect.ValueOf(strings.Count), + "Cut": reflect.ValueOf(strings.Cut), "EqualFold": reflect.ValueOf(strings.EqualFold), "Fields": reflect.ValueOf(strings.Fields), "FieldsFunc": reflect.ValueOf(strings.FieldsFunc), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sync.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sync.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_sync.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_sync.go index 6d6ef98..5de5054 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_sync.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sync.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sync'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["sync"] = map[string]reflect.Value{ + Symbols["sync/sync"] = map[string]reflect.Value{ // function, constant and variable definitions "NewCond": reflect.ValueOf(sync.NewCond), @@ -31,9 +32,14 @@ func init() { // _sync_Locker is an interface wrapper for Locker type type _sync_Locker struct { + IValue interface{} WLock func() WUnlock func() } -func (W _sync_Locker) Lock() { W.WLock() } -func (W _sync_Locker) Unlock() { W.WUnlock() } +func (W _sync_Locker) Lock() { + W.WLock() +} +func (W _sync_Locker) Unlock() { + W.WUnlock() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sync_atomic.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sync_atomic.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_sync_atomic.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_sync_atomic.go index 0d7c2b5..e3fe5aa 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_sync_atomic.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_sync_atomic.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract sync/atomic'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["sync/atomic"] = map[string]reflect.Value{ + Symbols["sync/atomic/atomic"] = map[string]reflect.Value{ // function, constant and variable definitions "AddInt32": reflect.ValueOf(atomic.AddInt32), "AddInt64": reflect.ValueOf(atomic.AddInt64), @@ -43,6 +44,12 @@ func init() { "SwapUintptr": reflect.ValueOf(atomic.SwapUintptr), // type definitions - "Value": reflect.ValueOf((*atomic.Value)(nil)), + "Bool": reflect.ValueOf((*atomic.Bool)(nil)), + "Int32": reflect.ValueOf((*atomic.Int32)(nil)), + "Int64": reflect.ValueOf((*atomic.Int64)(nil)), + "Uint32": reflect.ValueOf((*atomic.Uint32)(nil)), + "Uint64": reflect.ValueOf((*atomic.Uint64)(nil)), + "Uintptr": reflect.ValueOf((*atomic.Uintptr)(nil)), + "Value": reflect.ValueOf((*atomic.Value)(nil)), } } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing.go new file mode 100644 index 0000000..d65173b --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing.go @@ -0,0 +1,126 @@ +// Code generated by 'yaegi extract testing'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "reflect" + "testing" +) + +func init() { + Symbols["testing/testing"] = map[string]reflect.Value{ + // function, constant and variable definitions + "AllocsPerRun": reflect.ValueOf(testing.AllocsPerRun), + "Benchmark": reflect.ValueOf(testing.Benchmark), + "CoverMode": reflect.ValueOf(testing.CoverMode), + "Coverage": reflect.ValueOf(testing.Coverage), + "Init": reflect.ValueOf(testing.Init), + "Main": reflect.ValueOf(testing.Main), + "MainStart": reflect.ValueOf(testing.MainStart), + "RegisterCover": reflect.ValueOf(testing.RegisterCover), + "RunBenchmarks": reflect.ValueOf(testing.RunBenchmarks), + "RunExamples": reflect.ValueOf(testing.RunExamples), + "RunTests": reflect.ValueOf(testing.RunTests), + "Short": reflect.ValueOf(testing.Short), + "Verbose": reflect.ValueOf(testing.Verbose), + + // type definitions + "B": reflect.ValueOf((*testing.B)(nil)), + "BenchmarkResult": reflect.ValueOf((*testing.BenchmarkResult)(nil)), + "Cover": reflect.ValueOf((*testing.Cover)(nil)), + "CoverBlock": reflect.ValueOf((*testing.CoverBlock)(nil)), + "F": reflect.ValueOf((*testing.F)(nil)), + "InternalBenchmark": reflect.ValueOf((*testing.InternalBenchmark)(nil)), + "InternalExample": reflect.ValueOf((*testing.InternalExample)(nil)), + "InternalFuzzTarget": reflect.ValueOf((*testing.InternalFuzzTarget)(nil)), + "InternalTest": reflect.ValueOf((*testing.InternalTest)(nil)), + "M": reflect.ValueOf((*testing.M)(nil)), + "PB": reflect.ValueOf((*testing.PB)(nil)), + "T": reflect.ValueOf((*testing.T)(nil)), + "TB": reflect.ValueOf((*testing.TB)(nil)), + + // interface wrapper definitions + "_TB": reflect.ValueOf((*_testing_TB)(nil)), + } +} + +// _testing_TB is an interface wrapper for TB type +type _testing_TB struct { + IValue interface{} + WCleanup func(a0 func()) + WError func(args ...any) + WErrorf func(format string, args ...any) + WFail func() + WFailNow func() + WFailed func() bool + WFatal func(args ...any) + WFatalf func(format string, args ...any) + WHelper func() + WLog func(args ...any) + WLogf func(format string, args ...any) + WName func() string + WSetenv func(key string, value string) + WSkip func(args ...any) + WSkipNow func() + WSkipf func(format string, args ...any) + WSkipped func() bool + WTempDir func() string +} + +func (W _testing_TB) Cleanup(a0 func()) { + W.WCleanup(a0) +} +func (W _testing_TB) Error(args ...any) { + W.WError(args...) +} +func (W _testing_TB) Errorf(format string, args ...any) { + W.WErrorf(format, args...) +} +func (W _testing_TB) Fail() { + W.WFail() +} +func (W _testing_TB) FailNow() { + W.WFailNow() +} +func (W _testing_TB) Failed() bool { + return W.WFailed() +} +func (W _testing_TB) Fatal(args ...any) { + W.WFatal(args...) +} +func (W _testing_TB) Fatalf(format string, args ...any) { + W.WFatalf(format, args...) +} +func (W _testing_TB) Helper() { + W.WHelper() +} +func (W _testing_TB) Log(args ...any) { + W.WLog(args...) +} +func (W _testing_TB) Logf(format string, args ...any) { + W.WLogf(format, args...) +} +func (W _testing_TB) Name() string { + return W.WName() +} +func (W _testing_TB) Setenv(key string, value string) { + W.WSetenv(key, value) +} +func (W _testing_TB) Skip(args ...any) { + W.WSkip(args...) +} +func (W _testing_TB) SkipNow() { + W.WSkipNow() +} +func (W _testing_TB) Skipf(format string, args ...any) { + W.WSkipf(format, args...) +} +func (W _testing_TB) Skipped() bool { + return W.WSkipped() +} +func (W _testing_TB) TempDir() string { + return W.WTempDir() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_fstest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_fstest.go new file mode 100644 index 0000000..21a9a0a --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_fstest.go @@ -0,0 +1,22 @@ +// Code generated by 'yaegi extract testing/fstest'. DO NOT EDIT. + +//go:build go1.19 +// +build go1.19 + +package stdlib + +import ( + "reflect" + "testing/fstest" +) + +func init() { + Symbols["testing/fstest/fstest"] = map[string]reflect.Value{ + // function, constant and variable definitions + "TestFS": reflect.ValueOf(fstest.TestFS), + + // type definitions + "MapFS": reflect.ValueOf((*fstest.MapFS)(nil)), + "MapFile": reflect.ValueOf((*fstest.MapFile)(nil)), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_iotest.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_iotest.go similarity index 88% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_iotest.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_iotest.go index 7c852fb..ffe56d6 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_testing_iotest.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_iotest.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract testing/iotest'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["testing/iotest"] = map[string]reflect.Value{ + Symbols["testing/iotest/iotest"] = map[string]reflect.Value{ // function, constant and variable definitions "DataErrReader": reflect.ValueOf(iotest.DataErrReader), "ErrReader": reflect.ValueOf(iotest.ErrReader), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_quick.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_quick.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_quick.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_quick.go index 14463ab..3462174 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_testing_quick.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_testing_quick.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract testing/quick'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -11,7 +12,7 @@ import ( ) func init() { - Symbols["testing/quick"] = map[string]reflect.Value{ + Symbols["testing/quick/quick"] = map[string]reflect.Value{ // function, constant and variable definitions "Check": reflect.ValueOf(quick.Check), "CheckEqual": reflect.ValueOf(quick.CheckEqual), @@ -31,6 +32,7 @@ func init() { // _testing_quick_Generator is an interface wrapper for Generator type type _testing_quick_Generator struct { + IValue interface{} WGenerate func(rand *rand.Rand, size int) reflect.Value } diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_scanner.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_scanner.go similarity index 95% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_text_scanner.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_text_scanner.go index 8d8562c..9ccffe9 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_scanner.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_scanner.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/scanner'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["text/scanner"] = map[string]reflect.Value{ + Symbols["text/scanner/scanner"] = map[string]reflect.Value{ // function, constant and variable definitions "Char": reflect.ValueOf(constant.MakeFromLiteral("-5", token.INT, 0)), "Comment": reflect.ValueOf(constant.MakeFromLiteral("-8", token.INT, 0)), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_tabwriter.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_tabwriter.go similarity index 89% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_text_tabwriter.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_text_tabwriter.go index e63652f..446c2b5 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_text_tabwriter.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_tabwriter.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/tabwriter'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["text/tabwriter"] = map[string]reflect.Value{ + Symbols["text/tabwriter/tabwriter"] = map[string]reflect.Value{ // function, constant and variable definitions "AlignRight": reflect.ValueOf(tabwriter.AlignRight), "Debug": reflect.ValueOf(tabwriter.Debug), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template.go similarity index 92% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template.go index f15e830..78748ad 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/template'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["text/template"] = map[string]reflect.Value{ + Symbols["text/template/template"] = map[string]reflect.Value{ // function, constant and variable definitions "HTMLEscape": reflect.ValueOf(template.HTMLEscape), "HTMLEscapeString": reflect.ValueOf(template.HTMLEscapeString), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template_parse.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template_parse.go similarity index 81% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template_parse.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template_parse.go index 0f57b17..a34a985 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_text_template_parse.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_text_template_parse.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract text/template/parse'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,16 +11,18 @@ import ( ) func init() { - Symbols["text/template/parse"] = map[string]reflect.Value{ + Symbols["text/template/parse/parse"] = map[string]reflect.Value{ // function, constant and variable definitions "IsEmptyTree": reflect.ValueOf(parse.IsEmptyTree), "New": reflect.ValueOf(parse.New), "NewIdentifier": reflect.ValueOf(parse.NewIdentifier), "NodeAction": reflect.ValueOf(parse.NodeAction), "NodeBool": reflect.ValueOf(parse.NodeBool), + "NodeBreak": reflect.ValueOf(parse.NodeBreak), "NodeChain": reflect.ValueOf(parse.NodeChain), "NodeCommand": reflect.ValueOf(parse.NodeCommand), "NodeComment": reflect.ValueOf(parse.NodeComment), + "NodeContinue": reflect.ValueOf(parse.NodeContinue), "NodeDot": reflect.ValueOf(parse.NodeDot), "NodeField": reflect.ValueOf(parse.NodeField), "NodeIdentifier": reflect.ValueOf(parse.NodeIdentifier), @@ -36,14 +39,17 @@ func init() { "NodeWith": reflect.ValueOf(parse.NodeWith), "Parse": reflect.ValueOf(parse.Parse), "ParseComments": reflect.ValueOf(parse.ParseComments), + "SkipFuncCheck": reflect.ValueOf(parse.SkipFuncCheck), // type definitions "ActionNode": reflect.ValueOf((*parse.ActionNode)(nil)), "BoolNode": reflect.ValueOf((*parse.BoolNode)(nil)), "BranchNode": reflect.ValueOf((*parse.BranchNode)(nil)), + "BreakNode": reflect.ValueOf((*parse.BreakNode)(nil)), "ChainNode": reflect.ValueOf((*parse.ChainNode)(nil)), "CommandNode": reflect.ValueOf((*parse.CommandNode)(nil)), "CommentNode": reflect.ValueOf((*parse.CommentNode)(nil)), + "ContinueNode": reflect.ValueOf((*parse.ContinueNode)(nil)), "DotNode": reflect.ValueOf((*parse.DotNode)(nil)), "FieldNode": reflect.ValueOf((*parse.FieldNode)(nil)), "IdentifierNode": reflect.ValueOf((*parse.IdentifierNode)(nil)), @@ -71,13 +77,25 @@ func init() { // _text_template_parse_Node is an interface wrapper for Node type type _text_template_parse_Node struct { + IValue interface{} WCopy func() parse.Node WPosition func() parse.Pos WString func() string WType func() parse.NodeType } -func (W _text_template_parse_Node) Copy() parse.Node { return W.WCopy() } -func (W _text_template_parse_Node) Position() parse.Pos { return W.WPosition() } -func (W _text_template_parse_Node) String() string { return W.WString() } -func (W _text_template_parse_Node) Type() parse.NodeType { return W.WType() } +func (W _text_template_parse_Node) Copy() parse.Node { + return W.WCopy() +} +func (W _text_template_parse_Node) Position() parse.Pos { + return W.WPosition() +} +func (W _text_template_parse_Node) String() string { + if W.WString == nil { + return "" + } + return W.WString() +} +func (W _text_template_parse_Node) Type() parse.NodeType { + return W.WType() +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_time.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_time.go similarity index 93% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_time.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_time.go index 96dd814..d6a0fa4 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_time.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_time.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract time'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["time"] = map[string]reflect.Value{ + Symbols["time/time"] = map[string]reflect.Value{ // function, constant and variable definitions "ANSIC": reflect.ValueOf(constant.MakeFromLiteral("\"Mon Jan _2 15:04:05 2006\"", token.STRING, 0)), "After": reflect.ValueOf(time.After), @@ -29,6 +30,7 @@ func init() { "July": reflect.ValueOf(time.July), "June": reflect.ValueOf(time.June), "Kitchen": reflect.ValueOf(constant.MakeFromLiteral("\"3:04PM\"", token.STRING, 0)), + "Layout": reflect.ValueOf(constant.MakeFromLiteral("\"01/02 03:04:05PM '06 -0700\"", token.STRING, 0)), "LoadLocation": reflect.ValueOf(time.LoadLocation), "LoadLocationFromTZData": reflect.ValueOf(time.LoadLocationFromTZData), "Local": reflect.ValueOf(&time.Local).Elem(), @@ -71,6 +73,8 @@ func init() { "UTC": reflect.ValueOf(&time.UTC).Elem(), "Unix": reflect.ValueOf(time.Unix), "UnixDate": reflect.ValueOf(constant.MakeFromLiteral("\"Mon Jan _2 15:04:05 MST 2006\"", token.STRING, 0)), + "UnixMicro": reflect.ValueOf(time.UnixMicro), + "UnixMilli": reflect.ValueOf(time.UnixMilli), "Until": reflect.ValueOf(time.Until), "Wednesday": reflect.ValueOf(time.Wednesday), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode.go similarity index 99% rename from vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode.go index f706b44..12d1140 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_16_unicode.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode'. DO NOT EDIT. -// +build go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,7 +13,7 @@ import ( ) func init() { - Symbols["unicode"] = map[string]reflect.Value{ + Symbols["unicode/unicode"] = map[string]reflect.Value{ // function, constant and variable definitions "ASCII_Hex_Digit": reflect.ValueOf(&unicode.ASCII_Hex_Digit).Elem(), "Adlam": reflect.ValueOf(&unicode.Adlam).Elem(), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf16.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf16.go similarity index 82% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf16.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf16.go index 630741b..919f691 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf16.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf16.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode/utf16'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -10,7 +11,7 @@ import ( ) func init() { - Symbols["unicode/utf16"] = map[string]reflect.Value{ + Symbols["unicode/utf16/utf16"] = map[string]reflect.Value{ // function, constant and variable definitions "Decode": reflect.ValueOf(utf16.Decode), "DecodeRune": reflect.ValueOf(utf16.DecodeRune), diff --git a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf8.go b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf8.go similarity index 90% rename from vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf8.go rename to vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf8.go index beea317..2b0aa4a 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/go1_15_unicode_utf8.go +++ b/vendor/github.com/traefik/yaegi/stdlib/go1_19_unicode_utf8.go @@ -1,6 +1,7 @@ // Code generated by 'yaegi extract unicode/utf8'. DO NOT EDIT. -// +build go1.15,!go1.16 +//go:build go1.19 +// +build go1.19 package stdlib @@ -12,8 +13,9 @@ import ( ) func init() { - Symbols["unicode/utf8"] = map[string]reflect.Value{ + Symbols["unicode/utf8/utf8"] = map[string]reflect.Value{ // function, constant and variable definitions + "AppendRune": reflect.ValueOf(utf8.AppendRune), "DecodeLastRune": reflect.ValueOf(utf8.DecodeLastRune), "DecodeLastRuneInString": reflect.ValueOf(utf8.DecodeLastRuneInString), "DecodeRune": reflect.ValueOf(utf8.DecodeRune), diff --git a/vendor/github.com/traefik/yaegi/stdlib/maptypes.go b/vendor/github.com/traefik/yaegi/stdlib/maptypes.go new file mode 100644 index 0000000..3a697b7 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/maptypes.go @@ -0,0 +1,58 @@ +package stdlib + +import ( + "encoding" + "encoding/json" + "encoding/xml" + "fmt" + "log" + "reflect" +) + +func init() { + mt := []reflect.Type{ + reflect.TypeOf((*fmt.Formatter)(nil)).Elem(), + reflect.TypeOf((*fmt.Stringer)(nil)).Elem(), + } + + MapTypes[reflect.ValueOf(fmt.Errorf)] = mt + MapTypes[reflect.ValueOf(fmt.Fprint)] = mt + MapTypes[reflect.ValueOf(fmt.Fprintf)] = mt + MapTypes[reflect.ValueOf(fmt.Fprintln)] = mt + MapTypes[reflect.ValueOf(fmt.Print)] = mt + MapTypes[reflect.ValueOf(fmt.Printf)] = mt + MapTypes[reflect.ValueOf(fmt.Println)] = mt + MapTypes[reflect.ValueOf(fmt.Sprint)] = mt + MapTypes[reflect.ValueOf(fmt.Sprintf)] = mt + MapTypes[reflect.ValueOf(fmt.Sprintln)] = mt + + MapTypes[reflect.ValueOf(log.Fatal)] = mt + MapTypes[reflect.ValueOf(log.Fatalf)] = mt + MapTypes[reflect.ValueOf(log.Fatalln)] = mt + MapTypes[reflect.ValueOf(log.Panic)] = mt + MapTypes[reflect.ValueOf(log.Panicf)] = mt + MapTypes[reflect.ValueOf(log.Panicln)] = mt + + mt = []reflect.Type{reflect.TypeOf((*fmt.Scanner)(nil)).Elem()} + + MapTypes[reflect.ValueOf(fmt.Scan)] = mt + MapTypes[reflect.ValueOf(fmt.Scanf)] = mt + MapTypes[reflect.ValueOf(fmt.Scanln)] = mt + + MapTypes[reflect.ValueOf(json.Marshal)] = []reflect.Type{ + reflect.TypeOf((*json.Marshaler)(nil)).Elem(), + reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem(), + } + MapTypes[reflect.ValueOf(json.Unmarshal)] = []reflect.Type{ + reflect.TypeOf((*json.Unmarshaler)(nil)).Elem(), + reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem(), + } + MapTypes[reflect.ValueOf(xml.Marshal)] = []reflect.Type{ + reflect.TypeOf((*xml.Marshaler)(nil)).Elem(), + reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem(), + } + MapTypes[reflect.ValueOf(xml.Unmarshal)] = []reflect.Type{ + reflect.TypeOf((*xml.Unmarshaler)(nil)).Elem(), + reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem(), + } +} diff --git a/vendor/github.com/traefik/yaegi/stdlib/stdlib.go b/vendor/github.com/traefik/yaegi/stdlib/stdlib.go index 2e24e73..b4b0277 100644 --- a/vendor/github.com/traefik/yaegi/stdlib/stdlib.go +++ b/vendor/github.com/traefik/yaegi/stdlib/stdlib.go @@ -1,4 +1,5 @@ -// +build go1.15 +//go:build go1.18 +// +build go1.18 // Package stdlib provides wrappers of standard library packages to be imported natively in Yaegi. package stdlib @@ -8,10 +9,17 @@ import "reflect" // Symbols variable stores the map of stdlib symbols per package. var Symbols = map[string]map[string]reflect.Value{} +// MapTypes variable contains a map of functions which have an interface{} as parameter but +// do something special if the parameter implements a given interface. +var MapTypes = map[reflect.Value][]reflect.Type{} + func init() { - Symbols["github.com/traefik/yaegi/stdlib"] = map[string]reflect.Value{ + Symbols["github.com/traefik/yaegi/stdlib/stdlib"] = map[string]reflect.Value{ "Symbols": reflect.ValueOf(Symbols), } + Symbols["."] = map[string]reflect.Value{ + "MapTypes": reflect.ValueOf(MapTypes), + } } // Provide access to go standard library (http://golang.org/pkg/) @@ -26,27 +34,27 @@ func init() { //go:generate ../internal/cmd/extract/extract crypto/rc4 crypto/rsa crypto/sha1 crypto/sha256 crypto/sha512 //go:generate ../internal/cmd/extract/extract crypto/subtle crypto/tls crypto/x509 crypto/x509/pkix //go:generate ../internal/cmd/extract/extract database/sql database/sql/driver -//go:generate ../internal/cmd/extract/extract debug/dwarf debug/elf debug/gosym debug/macho debug/pe debug/plan9obj -//go:generate ../internal/cmd/extract/extract encoding encoding/ascii85 encoding/asn1 encoding/base32 +//go:generate ../internal/cmd/extract/extract debug/buildinfo debug/dwarf debug/elf debug/gosym debug/macho debug/pe debug/plan9obj +//go:generate ../internal/cmd/extract/extract embed encoding encoding/ascii85 encoding/asn1 encoding/base32 //go:generate ../internal/cmd/extract/extract encoding/base64 encoding/binary encoding/csv encoding/gob //go:generate ../internal/cmd/extract/extract encoding/hex encoding/json encoding/pem encoding/xml //go:generate ../internal/cmd/extract/extract errors expvar flag fmt -//go:generate ../internal/cmd/extract/extract go/ast go/build go/constant go/doc go/format go/importer +//go:generate ../internal/cmd/extract/extract go/ast go/build go/build/constraint go/constant go/doc go/format go/importer //go:generate ../internal/cmd/extract/extract go/parser go/printer go/scanner go/token go/types //go:generate ../internal/cmd/extract/extract hash hash/adler32 hash/crc32 hash/crc64 hash/fnv hash/maphash //go:generate ../internal/cmd/extract/extract html html/template //go:generate ../internal/cmd/extract/extract image image/color image/color/palette //go:generate ../internal/cmd/extract/extract image/draw image/gif image/jpeg image/png index/suffixarray -//go:generate ../internal/cmd/extract/extract io io/ioutil log log/syslog +//go:generate ../internal/cmd/extract/extract io io/fs io/ioutil log log/syslog //go:generate ../internal/cmd/extract/extract math math/big math/bits math/cmplx math/rand //go:generate ../internal/cmd/extract/extract mime mime/multipart mime/quotedprintable //go:generate ../internal/cmd/extract/extract net net/http net/http/cgi net/http/cookiejar net/http/fcgi //go:generate ../internal/cmd/extract/extract net/http/httptest net/http/httptrace net/http/httputil net/http/pprof -//go:generate ../internal/cmd/extract/extract net/mail net/rpc net/rpc/jsonrpc net/smtp net/textproto net/url +//go:generate ../internal/cmd/extract/extract net/mail net/netip net/rpc net/rpc/jsonrpc net/smtp net/textproto net/url //go:generate ../internal/cmd/extract/extract os os/signal os/user //go:generate ../internal/cmd/extract/extract path path/filepath reflect regexp regexp/syntax -//go:generate ../internal/cmd/extract/extract runtime runtime/debug runtime/pprof runtime/trace +//go:generate ../internal/cmd/extract/extract runtime runtime/debug runtime/metrics runtime/pprof runtime/trace //go:generate ../internal/cmd/extract/extract sort strconv strings sync sync/atomic -//go:generate ../internal/cmd/extract/extract testing testing/iotest testing/quick +//go:generate ../internal/cmd/extract/extract testing testing/fstest testing/iotest testing/quick //go:generate ../internal/cmd/extract/extract text/scanner text/tabwriter text/template text/template/parse //go:generate ../internal/cmd/extract/extract time unicode unicode/utf16 unicode/utf8 diff --git a/vendor/github.com/traefik/yaegi/stdlib/stdlib_go1.16.go b/vendor/github.com/traefik/yaegi/stdlib/stdlib_go1.16.go deleted file mode 100644 index 967e052..0000000 --- a/vendor/github.com/traefik/yaegi/stdlib/stdlib_go1.16.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build go1.16 - -package stdlib - -//go:generate ../internal/cmd/extract/extract embed diff --git a/vendor/github.com/traefik/yaegi/stdlib/wrapper-composed.go b/vendor/github.com/traefik/yaegi/stdlib/wrapper-composed.go new file mode 100644 index 0000000..c5c5350 --- /dev/null +++ b/vendor/github.com/traefik/yaegi/stdlib/wrapper-composed.go @@ -0,0 +1,88 @@ +package stdlib + +import ( + "bufio" + "io" + "net" + "net/http" + "reflect" +) + +// Wrappers for composed interfaces which trigger a special behavior in stdlib. +// Note: it may become useless to pre-compile composed interface wrappers +// once golang/go#15924 is resolved. + +// In net/http, a ResponseWriter may also implement a Hijacker. + +type _netHTTPResponseWriterHijacker struct { + IValue interface{} + WHeader func() http.Header + WWrite func(a0 []byte) (int, error) + WWriteHeader func(statusCode int) + + WHijack func() (net.Conn, *bufio.ReadWriter, error) +} + +func (w _netHTTPResponseWriterHijacker) Header() http.Header { + return w.WHeader() +} + +func (w _netHTTPResponseWriterHijacker) Write(a0 []byte) (int, error) { + return w.WWrite(a0) +} + +func (w _netHTTPResponseWriterHijacker) WriteHeader(statusCode int) { + w.WWriteHeader(statusCode) +} + +func (w _netHTTPResponseWriterHijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return w.WHijack() +} + +// In io, a Reader may implement WriteTo, used by io.Copy(). + +type _ioReaderWriteTo struct { + IValue interface{} + WRead func(p []byte) (n int, err error) + + WWriteTo func(w io.Writer) (n int64, err error) +} + +func (w _ioReaderWriteTo) Read(p []byte) (n int, err error) { + return w.WRead(p) +} + +func (w _ioReaderWriteTo) WriteTo(wr io.Writer) (n int64, err error) { + return w.WWriteTo(wr) +} + +// In io, a Writer may implement ReadFrom, used by io.Copy(). + +type _ioWriterReadFrom struct { + IValue interface{} + WWrite func(p []byte) (n int, err error) + + WReadFrom func(r io.Reader) (n int64, err error) +} + +func (w _ioWriterReadFrom) Write(p []byte) (n int, err error) { + return w.WWrite(p) +} + +func (w _ioWriterReadFrom) ReadFrom(r io.Reader) (n int64, err error) { + return w.WReadFrom(r) +} + +// Each MapType value (each slice) must be sorted by complexity, i.e. by number +// of interface methods. +func init() { + MapTypes[reflect.ValueOf((*_net_http_ResponseWriter)(nil))] = []reflect.Type{ + reflect.ValueOf((*_netHTTPResponseWriterHijacker)(nil)).Type().Elem(), + } + MapTypes[reflect.ValueOf((*_io_Reader)(nil))] = []reflect.Type{ + reflect.ValueOf((*_ioReaderWriteTo)(nil)).Type().Elem(), + } + MapTypes[reflect.ValueOf((*_io_Writer)(nil))] = []reflect.Type{ + reflect.ValueOf((*_ioWriterReadFrom)(nil)).Type().Elem(), + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 99611c9..b4f215e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,8 +36,9 @@ github.com/pmezard/go-difflib/difflib ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/traefik/yaegi v0.9.15 +# github.com/traefik/yaegi v0.14.2 ## explicit +github.com/traefik/yaegi/internal/unsafe2 github.com/traefik/yaegi/interp github.com/traefik/yaegi/stdlib # go.uber.org/atomic v1.7.0