aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-06-11 17:24:54 +0200
committerRon Evans <[email protected]>2022-08-30 12:38:06 +0200
commit4695da83b71c291bc89a14dc41c9b9a91a3c6210 (patch)
tree3b4ed26f336833d4e80f1963e598714c66575bd7 /loader
parentf094e895c55204730b0230b3b2f6fc3bb32f325a (diff)
downloadtinygo-4695da83b71c291bc89a14dc41c9b9a91a3c6210.tar.gz
tinygo-4695da83b71c291bc89a14dc41c9b9a91a3c6210.zip
all: drop support for Go 1.16 and Go 1.17
Diffstat (limited to 'loader')
-rw-r--r--loader/goroot.go1
-rw-r--r--loader/loader.go6
-rw-r--r--loader/loader_go118.go18
3 files changed, 1 insertions, 24 deletions
diff --git a/loader/goroot.go b/loader/goroot.go
index f1d28b0ea..1a16acf0a 100644
--- a/loader/goroot.go
+++ b/loader/goroot.go
@@ -235,7 +235,6 @@ func pathsToOverride(needsSyscallPackage bool) map[string]bool {
"internal/bytealg/": false,
"internal/reflectlite/": false,
"internal/task/": false,
- "internal/itoa/": false, // TODO: Remove when we drop support for go 1.16
"machine/": false,
"net/": true,
"os/": true,
diff --git a/loader/loader.go b/loader/loader.go
index 6f49982db..6ced36dcd 100644
--- a/loader/loader.go
+++ b/loader/loader.go
@@ -27,8 +27,6 @@ import (
"github.com/tinygo-org/tinygo/goenv"
)
-var addInstances func(*types.Info)
-
// Program holds all packages and some metadata about the program as a whole.
type Program struct {
config *compileopts.Config
@@ -158,6 +156,7 @@ func Load(config *compileopts.Config, inputPkg string, clangHeaders string, type
EmbedGlobals: make(map[string][]*EmbedFile),
info: types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
+ Instances: make(map[*ast.Ident]types.Instance),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
@@ -165,9 +164,6 @@ func Load(config *compileopts.Config, inputPkg string, clangHeaders string, type
Selections: make(map[*ast.SelectorExpr]*types.Selection),
},
}
- if addInstances != nil {
- addInstances(&pkg.info)
- }
err := decoder.Decode(&pkg.PackageJSON)
if err != nil {
if err == io.EOF {
diff --git a/loader/loader_go118.go b/loader/loader_go118.go
deleted file mode 100644
index d545160e7..000000000
--- a/loader/loader_go118.go
+++ /dev/null
@@ -1,18 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-package loader
-
-// Workaround for Go 1.17 support. Should be removed once we drop Go 1.17
-// support.
-
-import (
- "go/ast"
- "go/types"
-)
-
-func init() {
- addInstances = func(info *types.Info) {
- info.Instances = make(map[*ast.Ident]types.Instance)
- }
-}