Skip to content

Commit

Permalink
[skip-changelog] Update golang to 1.21.1 (#2319)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini authored Sep 15, 2023
1 parent 4c0d72e commit 55fc5aa
Show file tree
Hide file tree
Showing 42 changed files with 85 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-easyjson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check easyjson generated files

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

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check Go Dependencies

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

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check Go

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

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-i18n-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check Internationalization

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

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.20"
GO_VERSION: "1.21"

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check Website

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-protobuf-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check Protocol Buffers

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

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Website

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/i18n-weekly-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: i18n-weekly-pull

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

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test Go

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

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: github.com/gofrs/uuid
version: v3.2.0+incompatible
name: github.com/gofrs/uuid/v5
version: v5.0.0
type: go
summary: Package uuid provides implementations of the Universally Unique Identifier
(UUID), as specified in RFC-4122 and DCE 1.1.
homepage: https://pkg.go.dev/github.com/gofrs/uuid
(UUID), as specified in RFC-4122 and the Peabody RFC Draft (revision 03).
homepage: https://pkg.go.dev/github.com/gofrs/uuid/v5
license: mit
licenses:
- sources: LICENSE
Expand Down
63 changes: 0 additions & 63 deletions .licenses/go/golang.org/x/exp/constraints.dep.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .licenses/go/golang.org/x/exp/slices.dep.yml

This file was deleted.

2 changes: 1 addition & 1 deletion DistTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version: "3"

vars:
CONTAINER: "docker.elastic.co/beats-dev/golang-crossbuild"
GO_VERSION: "1.20.1"
GO_VERSION: "1.21.1"

tasks:
Windows_32bit:
Expand Down
4 changes: 2 additions & 2 deletions arduino/builder/cpp/cpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
// preprocessor. This adds double quotes around it and escapes any
// double quotes and backslashes in the string.
func QuoteString(str string) string {
str = strings.Replace(str, "\\", "\\\\", -1)
str = strings.Replace(str, "\"", "\\\"", -1)
str = strings.ReplaceAll(str, "\\", "\\\\")
str = strings.ReplaceAll(str, "\"", "\\\"")
return "\"" + str + "\""
}

Expand Down
3 changes: 1 addition & 2 deletions arduino/builder/detector/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import (
"fmt"
"os/exec"
"regexp"
"slices"
"strings"
"time"

"golang.org/x/exp/slices"

"github.com/arduino/arduino-cli/arduino/builder/logger"
"github.com/arduino/arduino-cli/arduino/builder/preprocessor"
"github.com/arduino/arduino-cli/arduino/builder/utils"
Expand Down
2 changes: 1 addition & 1 deletion arduino/builder/export_cmake.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"os"
"path/filepath"
"regexp"
"slices"
"strings"

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

"github.com/arduino/arduino-cli/arduino/builder/utils"
"github.com/arduino/arduino-cli/arduino/globals"
Expand Down
2 changes: 1 addition & 1 deletion arduino/builder/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package builder

import (
"slices"
"strings"
"time"

Expand All @@ -26,7 +27,6 @@ import (
"github.com/arduino/go-paths-helper"
"github.com/arduino/go-properties-orderedmap"
"github.com/pkg/errors"
"golang.org/x/exp/slices"
)

// nolint
Expand Down
4 changes: 2 additions & 2 deletions arduino/builder/preprocessor/ctags.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func PreprocessSketchWithCtags(sketch *sketch.Sketch, buildPath *paths.Path, inc
} else {
return normalOutput.Bytes(), verboseOutput.Bytes(), err
}
source = strings.Replace(source, "\r\n", "\n", -1)
source = strings.Replace(source, "\r", "\n", -1)
source = strings.ReplaceAll(source, "\r\n", "\n")
source = strings.ReplaceAll(source, "\r", "\n")
sourceRows := strings.Split(source, "\n")
if isFirstFunctionOutsideOfSource(firstFunctionLine, sourceRows) {
return normalOutput.Bytes(), verboseOutput.Bytes(), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ package ctags
import (
"bufio"
"os"
"slices"
"strings"

"golang.org/x/exp/slices"
)

func (p *Parser) fixCLinkageTagsDeclarations() {
Expand Down
14 changes: 7 additions & 7 deletions arduino/builder/preprocessor/internal/ctags/ctags_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
const kindPrototype = "prototype"
const kindFunction = "function"

//const KIND_PROTOTYPE_MODIFIERS = "prototype_modifiers"
// const KIND_PROTOTYPE_MODIFIERS = "prototype_modifiers"

const keywordTemplate = "template"
const keywordStatic = "static"
Expand Down Expand Up @@ -101,7 +101,7 @@ func addPrototype(tag *Tag) {
}
tag.Prototype = code + ";"
} else {
//tag.Code is 99% multiline, recreate it
// tag.Code is 99% multiline, recreate it
code := findTemplateMultiline(tag)
tag.Prototype = code + ";"
}
Expand All @@ -128,7 +128,7 @@ func (p *Parser) removeDefinedProtypes() {

for _, tag := range p.tags {
if definedPrototypes[tag.Prototype] {
//if ctx.DebugLevel >= 10 {
// if ctx.DebugLevel >= 10 {
// ctx.GetLogger().Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, constants.MSG_SKIPPING_TAG_ALREADY_DEFINED, tag.FunctionName)
//}
tag.SkipMe = true
Expand All @@ -154,7 +154,7 @@ func (p *Parser) skipTagsWhere(skipFunc skipFuncType) {
for _, tag := range p.tags {
if !tag.SkipMe {
skip := skipFunc(tag)
//if skip && p.debugLevel >= 10 {
// if skip && p.debugLevel >= 10 {
// ctx.GetLogger().Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, constants.MSG_SKIPPING_TAG_WITH_REASON, tag.FunctionName, runtime.FuncForPC(reflect.ValueOf(skipFunc).Pointer()).Name())
//}
tag.SkipMe = skip
Expand All @@ -167,8 +167,8 @@ func removeTralingSemicolon(s string) string {
}

func removeSpacesAndTabs(s string) string {
s = strings.Replace(s, " ", "", -1)
s = strings.Replace(s, "\t", "", -1)
s = strings.ReplaceAll(s, " ", "")
s = strings.ReplaceAll(s, "\t", "")
return s
}

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

parts = parts[2:]

Expand Down
2 changes: 1 addition & 1 deletion arduino/cores/packagemanager/package_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func TestBoardOrdering(t *testing.T) {
}

func TestFindToolsRequiredForBoard(t *testing.T) {
os.Setenv("ARDUINO_DATA_DIR", dataDir1.String())
t.Setenv("ARDUINO_DATA_DIR", dataDir1.String())
configuration.Settings = configuration.Init("")
pmb := NewBuilder(
dataDir1,
Expand Down
2 changes: 1 addition & 1 deletion arduino/libraries/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,
version := strings.TrimSpace(libProperties.Get("version"))
if v, err := semver.Parse(version); err != nil {
// FIXME: do it in linter?
//fmt.Printf("invalid version %s for library in %s: %s", version, libraryDir, err)
// fmt.Printf("invalid version %s for library in %s: %s", version, libraryDir, err)
} else {
library.Version = v
}
Expand Down
Loading

0 comments on commit 55fc5aa

Please sign in to comment.