Skip to content

Commit

Permalink
stdlib: remove embed wrapper
Browse files Browse the repository at this point in the history
Embedding files using `//go:embed` and `embed` packages can not be supported in yaegi, so it is better to not generate the wrapper to embed and have a graceful error in case of usage of `embed.FS` in the interpreter.
Also update README about unsuported directives.

Fixes #1557.
  • Loading branch information
mvertes committed Jun 14, 2023
1 parent 6447a67 commit f4a9cd3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 37 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Beside the known [bugs] which are supposed to be fixed in the short term, there

- Assembly files (`.s`) are not supported.
- Calling C code is not supported (no virtual "C" package).
- Directives about the compiler, the linker, or embedding files are not supported.
- Interfaces to be used from the pre-compiled code can not be added dynamically, as it is required to pre-compile interface wrappers.
- Representation of types by `reflect` and printing values using %T may give different results between compiled mode and interpreted mode.
- Interpreting computation intensive code is likely to remain significantly slower than in compiled mode.
Expand Down
18 changes: 0 additions & 18 deletions stdlib/go1_19_embed.go

This file was deleted.

18 changes: 0 additions & 18 deletions stdlib/go1_20_embed.go

This file was deleted.

2 changes: 1 addition & 1 deletion stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {
//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/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 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
Expand Down

0 comments on commit f4a9cd3

Please sign in to comment.