Skip to content

Commit 55fc5aa

Browse files
[skip-changelog] Update golang to 1.21.1 (#2319)
1 parent 4c0d72e commit 55fc5aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+85
-212
lines changed

Diff for: .github/workflows/check-easyjson.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check easyjson generated files
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.20"
5+
GO_VERSION: "1.21"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

Diff for: .github/workflows/check-go-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Go Dependencies
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.20"
6+
GO_VERSION: "1.21"
77

88
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
99
on:

Diff for: .github/workflows/check-go-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Go
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.20"
6+
GO_VERSION: "1.21"
77

88
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
99
on:

Diff for: .github/workflows/check-i18n-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Internationalization
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.20"
5+
GO_VERSION: "1.21"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

Diff for: .github/workflows/check-markdown-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
# See: https://github.com/actions/setup-node/#readme
66
NODE_VERSION: 16.x
77
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
8-
GO_VERSION: "1.20"
8+
GO_VERSION: "1.21"
99

1010
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1111
on:

Diff for: .github/workflows/check-mkdocs-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Website
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.20"
6+
GO_VERSION: "1.21"
77
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
88
PYTHON_VERSION: "3.9"
99

Diff for: .github/workflows/check-protobuf-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Protocol Buffers
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.20"
5+
GO_VERSION: "1.21"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

Diff for: .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Website
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.20"
6+
GO_VERSION: "1.21"
77
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
88
PYTHON_VERSION: "3.9"
99

Diff for: .github/workflows/i18n-weekly-pull.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: i18n-weekly-pull
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.20"
5+
GO_VERSION: "1.21"
66
COVERAGE_ARTIFACT: coverage-data
77

88
on:

Diff for: .github/workflows/test-go-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test Go
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.20"
6+
GO_VERSION: "1.21"
77
COVERAGE_ARTIFACT: coverage-data
88

99
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows

Diff for: .licenses/go/github.com/gofrs/uuid.dep.yml renamed to .licenses/go/github.com/gofrs/uuid/v5.dep.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
name: github.com/gofrs/uuid
3-
version: v3.2.0+incompatible
2+
name: github.com/gofrs/uuid/v5
3+
version: v5.0.0
44
type: go
55
summary: Package uuid provides implementations of the Universally Unique Identifier
6-
(UUID), as specified in RFC-4122 and DCE 1.1.
7-
homepage: https://pkg.go.dev/github.com/gofrs/uuid
6+
(UUID), as specified in RFC-4122 and the Peabody RFC Draft (revision 03).
7+
homepage: https://pkg.go.dev/github.com/gofrs/uuid/v5
88
license: mit
99
licenses:
1010
- sources: LICENSE

Diff for: .licenses/go/golang.org/x/exp/constraints.dep.yml

-63
This file was deleted.

Diff for: .licenses/go/golang.org/x/exp/slices.dep.yml

-62
This file was deleted.

Diff for: DistTasks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ version: "3"
1919

2020
vars:
2121
CONTAINER: "docker.elastic.co/beats-dev/golang-crossbuild"
22-
GO_VERSION: "1.20.1"
22+
GO_VERSION: "1.21.1"
2323

2424
tasks:
2525
Windows_32bit:

Diff for: arduino/builder/cpp/cpp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727
// preprocessor. This adds double quotes around it and escapes any
2828
// double quotes and backslashes in the string.
2929
func QuoteString(str string) string {
30-
str = strings.Replace(str, "\\", "\\\\", -1)
31-
str = strings.Replace(str, "\"", "\\\"", -1)
30+
str = strings.ReplaceAll(str, "\\", "\\\\")
31+
str = strings.ReplaceAll(str, "\"", "\\\"")
3232
return "\"" + str + "\""
3333
}
3434

Diff for: arduino/builder/detector/detector.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ import (
2121
"fmt"
2222
"os/exec"
2323
"regexp"
24+
"slices"
2425
"strings"
2526
"time"
2627

27-
"golang.org/x/exp/slices"
28-
2928
"github.com/arduino/arduino-cli/arduino/builder/logger"
3029
"github.com/arduino/arduino-cli/arduino/builder/preprocessor"
3130
"github.com/arduino/arduino-cli/arduino/builder/utils"

Diff for: arduino/builder/export_cmake.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"os"
2222
"path/filepath"
2323
"regexp"
24+
"slices"
2425
"strings"
2526

2627
"github.com/arduino/go-paths-helper"
2728
properties "github.com/arduino/go-properties-orderedmap"
28-
"golang.org/x/exp/slices"
2929

3030
"github.com/arduino/arduino-cli/arduino/builder/utils"
3131
"github.com/arduino/arduino-cli/arduino/globals"

Diff for: arduino/builder/libraries.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package builder
1717

1818
import (
19+
"slices"
1920
"strings"
2021
"time"
2122

@@ -26,7 +27,6 @@ import (
2627
"github.com/arduino/go-paths-helper"
2728
"github.com/arduino/go-properties-orderedmap"
2829
"github.com/pkg/errors"
29-
"golang.org/x/exp/slices"
3030
)
3131

3232
// nolint

Diff for: arduino/builder/preprocessor/ctags.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ func PreprocessSketchWithCtags(sketch *sketch.Sketch, buildPath *paths.Path, inc
103103
} else {
104104
return normalOutput.Bytes(), verboseOutput.Bytes(), err
105105
}
106-
source = strings.Replace(source, "\r\n", "\n", -1)
107-
source = strings.Replace(source, "\r", "\n", -1)
106+
source = strings.ReplaceAll(source, "\r\n", "\n")
107+
source = strings.ReplaceAll(source, "\r", "\n")
108108
sourceRows := strings.Split(source, "\n")
109109
if isFirstFunctionOutsideOfSource(firstFunctionLine, sourceRows) {
110110
return normalOutput.Bytes(), verboseOutput.Bytes(), nil

Diff for: arduino/builder/preprocessor/internal/ctags/ctags_has_issues.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ package ctags
1818
import (
1919
"bufio"
2020
"os"
21+
"slices"
2122
"strings"
22-
23-
"golang.org/x/exp/slices"
2423
)
2524

2625
func (p *Parser) fixCLinkageTagsDeclarations() {

Diff for: arduino/builder/preprocessor/internal/ctags/ctags_parser.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
const kindPrototype = "prototype"
2626
const kindFunction = "function"
2727

28-
//const KIND_PROTOTYPE_MODIFIERS = "prototype_modifiers"
28+
// const KIND_PROTOTYPE_MODIFIERS = "prototype_modifiers"
2929

3030
const keywordTemplate = "template"
3131
const keywordStatic = "static"
@@ -101,7 +101,7 @@ func addPrototype(tag *Tag) {
101101
}
102102
tag.Prototype = code + ";"
103103
} else {
104-
//tag.Code is 99% multiline, recreate it
104+
// tag.Code is 99% multiline, recreate it
105105
code := findTemplateMultiline(tag)
106106
tag.Prototype = code + ";"
107107
}
@@ -128,7 +128,7 @@ func (p *Parser) removeDefinedProtypes() {
128128

129129
for _, tag := range p.tags {
130130
if definedPrototypes[tag.Prototype] {
131-
//if ctx.DebugLevel >= 10 {
131+
// if ctx.DebugLevel >= 10 {
132132
// ctx.GetLogger().Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, constants.MSG_SKIPPING_TAG_ALREADY_DEFINED, tag.FunctionName)
133133
//}
134134
tag.SkipMe = true
@@ -154,7 +154,7 @@ func (p *Parser) skipTagsWhere(skipFunc skipFuncType) {
154154
for _, tag := range p.tags {
155155
if !tag.SkipMe {
156156
skip := skipFunc(tag)
157-
//if skip && p.debugLevel >= 10 {
157+
// if skip && p.debugLevel >= 10 {
158158
// ctx.GetLogger().Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, constants.MSG_SKIPPING_TAG_WITH_REASON, tag.FunctionName, runtime.FuncForPC(reflect.ValueOf(skipFunc).Pointer()).Name())
159159
//}
160160
tag.SkipMe = skip
@@ -167,8 +167,8 @@ func removeTralingSemicolon(s string) string {
167167
}
168168

169169
func removeSpacesAndTabs(s string) string {
170-
s = strings.Replace(s, " ", "", -1)
171-
s = strings.Replace(s, "\t", "", -1)
170+
s = strings.ReplaceAll(s, " ", "")
171+
s = strings.ReplaceAll(s, "\t", "")
172172
return s
173173
}
174174

@@ -205,7 +205,7 @@ func parseTag(row string) *Tag {
205205
// and just cuts off the filename at the first double quote it
206206
// sees. This means any backslashes are still escaped, and need
207207
// to be unescape, and any quotes will just break the build.
208-
tag.Filename = strings.Replace(parts[1], "\\\\", "\\", -1)
208+
tag.Filename = strings.ReplaceAll(parts[1], "\\\\", "\\")
209209

210210
parts = parts[2:]
211211

Diff for: arduino/cores/packagemanager/package_manager_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ func TestBoardOrdering(t *testing.T) {
431431
}
432432

433433
func TestFindToolsRequiredForBoard(t *testing.T) {
434-
os.Setenv("ARDUINO_DATA_DIR", dataDir1.String())
434+
t.Setenv("ARDUINO_DATA_DIR", dataDir1.String())
435435
configuration.Settings = configuration.Init("")
436436
pmb := NewBuilder(
437437
dataDir1,

Diff for: arduino/libraries/loader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,
103103
version := strings.TrimSpace(libProperties.Get("version"))
104104
if v, err := semver.Parse(version); err != nil {
105105
// FIXME: do it in linter?
106-
//fmt.Printf("invalid version %s for library in %s: %s", version, libraryDir, err)
106+
// fmt.Printf("invalid version %s for library in %s: %s", version, libraryDir, err)
107107
} else {
108108
library.Version = v
109109
}

0 commit comments

Comments
 (0)