diff options
author | Ayke van Laethem <[email protected]> | 2022-09-15 16:18:15 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-09-15 19:07:04 +0200 |
commit | 9e4e182615cd80303c564f95020e0c3bd10af64a (patch) | |
tree | 74672ad0a55bfb54c998a7500ef0bfc18627dd0f /testdata | |
parent | 5f96d2b7843ceebeedd91acae0985f3bcb8a7516 (diff) | |
download | tinygo-9e4e182615cd80303c564f95020e0c3bd10af64a.tar.gz tinygo-9e4e182615cd80303c564f95020e0c3bd10af64a.zip |
interp: fix reading from external global
This fixes https://github.com/tinygo-org/tinygo/issues/3020.
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/embed/embed.go | 3 | ||||
-rw-r--r-- | testdata/embed/out.txt | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/testdata/embed/embed.go b/testdata/embed/embed.go index da6587189..4b2a052c4 100644 --- a/testdata/embed/embed.go +++ b/testdata/embed/embed.go @@ -20,9 +20,12 @@ var ( //go:embed a/b/.hidden var hidden string +var helloStringBytes = []byte(helloString) + func main() { println("string:", strings.TrimSpace(helloString)) println("bytes:", strings.TrimSpace(string(helloBytes))) + println("[]byte(string):", strings.TrimSpace(string(helloStringBytes))) println("files:") readFiles(".") } diff --git a/testdata/embed/out.txt b/testdata/embed/out.txt index 3b216da7b..b14b15015 100644 --- a/testdata/embed/out.txt +++ b/testdata/embed/out.txt @@ -1,5 +1,6 @@ string: hello world! bytes: hello world! +[]byte(string): hello world! files: - a - a/b |