From 3d0907d5b66b983b243968f206c9f2a22ab3a189 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 30 Jun 2022 10:42:25 -0700 Subject: [PATCH] Update go to 1.18.3 --- WORKSPACE | 2 +- tools/go_types_memoize.patch | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 4278aff66..f11757790 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -70,7 +70,7 @@ go_download_sdk( # time on our continuous integration. patch = "//tools:go_types_memoize.patch", patch_strip = 2, - version = "1.17.6", + version = "1.18.3", ) gazelle_dependencies() diff --git a/tools/go_types_memoize.patch b/tools/go_types_memoize.patch index 215206eba..306788b79 100644 --- a/tools/go_types_memoize.patch +++ b/tools/go_types_memoize.patch @@ -1,20 +1,26 @@ -diff '--color=auto' -r -u2 a/go/src/go/types/scope.go b/go/src/go/types/scope.go ---- a/go/src/go/types/scope.go 2022-01-06 19:14:25.000000000 +0000 -+++ b/go/src/go/types/scope.go 2022-02-03 18:50:35.526563967 +0000 -@@ -24,4 +24,5 @@ +diff --git a/go/src/go/types/scope.go b/src/go/types/scope.go +index 010727eb72..0f134b872e 100644 +--- a/go/src/go/types/scope.go ++++ b/go/src/go/types/scope.go +@@ -25,6 +25,7 @@ type Scope struct { children []*Scope + number int // parent.children[number-1] is this scope; 0 if there is no parent elems map[string]Object // lazily allocated + sorted []string // lazily allocated pos, end token.Pos // scope extent; may be invalid comment string // for debugging only -@@ -32,5 +33,5 @@ + isFunc bool // set if this is a function scope (internal use only) +@@ -33,7 +34,7 @@ type Scope struct { + // NewScope returns a new, empty scope contained in the given parent // scope, if any. The comment is for debugging only. func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope { -- s := &Scope{parent, nil, nil, pos, end, comment, false} -+ s := &Scope{parent, nil, nil, nil, pos, end, comment, false} +- s := &Scope{parent, nil, 0, nil, pos, end, comment, false} ++ s := &Scope{parent, nil, 0, nil, nil, pos, end, comment, false} // don't add children to Universe scope! if parent != nil && parent != Universe { -@@ -48,12 +49,14 @@ + parent.children = append(parent.children, s) +@@ -50,14 +51,16 @@ func (s *Scope) Len() int { return len(s.elems) } + // Names returns the scope's element names in sorted order. func (s *Scope) Names() []string { - names := make([]string, len(s.elems)) @@ -36,4 +42,4 @@ diff '--color=auto' -r -u2 a/go/src/go/types/scope.go b/go/src/go/types/scope.go + return s.sorted } -Only in b/go/src/go/types: scope.go.orig + // NumChildren returns the number of scopes nested in s.