From faae879bce02d6e85da55c6a2090b2b0b5081b6d Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 16:33:27 +0200 Subject: [PATCH 01/13] bump github.com/gofrs/uuid to v5 --- go.mod | 4 +--- go.sum | 4 ++-- internal/inventory/inventory.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 84073db5622..1f0c629c8e5 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,7 @@ require ( github.com/djherbis/buffer v1.1.0 github.com/djherbis/nio/v3 v3.0.1 github.com/fatih/color v1.7.0 - github.com/gofrs/uuid v3.2.0+incompatible - github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/gofrs/uuid/v5 v5.0.0 github.com/leonelquinteros/gotext v1.4.0 github.com/mailru/easyjson v0.7.7 github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84 diff --git a/go.sum b/go.sum index f33a5295fbb..741ba933e94 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= +github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/internal/inventory/inventory.go b/internal/inventory/inventory.go index ff7aab2c549..d366278e1e7 100644 --- a/internal/inventory/inventory.go +++ b/internal/inventory/inventory.go @@ -22,7 +22,7 @@ import ( "sync" "github.com/arduino/arduino-cli/i18n" - "github.com/gofrs/uuid" + "github.com/gofrs/uuid/v5" "github.com/sirupsen/logrus" "github.com/spf13/viper" ) From 4192900f494a327b7b5a063d4ce89987357b6537 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 16:42:00 +0200 Subject: [PATCH 02/13] use stdlib slices --- arduino/builder/detector/detector.go | 3 +-- arduino/builder/export_cmake.go | 2 +- arduino/builder/libraries.go | 2 +- .../builder/preprocessor/internal/ctags/ctags_has_issues.go | 3 +-- internal/integrationtest/compile_3/core_caching_test.go | 2 +- internal/integrationtest/compile_4/compile_test.go | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/arduino/builder/detector/detector.go b/arduino/builder/detector/detector.go index 1de2017d773..50a35a016e8 100644 --- a/arduino/builder/detector/detector.go +++ b/arduino/builder/detector/detector.go @@ -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" diff --git a/arduino/builder/export_cmake.go b/arduino/builder/export_cmake.go index 06360a55ec9..456cd298424 100644 --- a/arduino/builder/export_cmake.go +++ b/arduino/builder/export_cmake.go @@ -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" diff --git a/arduino/builder/libraries.go b/arduino/builder/libraries.go index 9efa62df378..cb580766e0c 100644 --- a/arduino/builder/libraries.go +++ b/arduino/builder/libraries.go @@ -16,6 +16,7 @@ package builder import ( + "slices" "strings" "time" @@ -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 diff --git a/arduino/builder/preprocessor/internal/ctags/ctags_has_issues.go b/arduino/builder/preprocessor/internal/ctags/ctags_has_issues.go index 4d4d7d48f65..0b72abed8d5 100644 --- a/arduino/builder/preprocessor/internal/ctags/ctags_has_issues.go +++ b/arduino/builder/preprocessor/internal/ctags/ctags_has_issues.go @@ -18,9 +18,8 @@ package ctags import ( "bufio" "os" + "slices" "strings" - - "golang.org/x/exp/slices" ) func (p *Parser) fixCLinkageTagsDeclarations() { diff --git a/internal/integrationtest/compile_3/core_caching_test.go b/internal/integrationtest/compile_3/core_caching_test.go index 856aad9c38e..d64129ccc8f 100644 --- a/internal/integrationtest/compile_3/core_caching_test.go +++ b/internal/integrationtest/compile_3/core_caching_test.go @@ -18,11 +18,11 @@ package compile_test import ( "strings" "testing" + "slices" "github.com/arduino/arduino-cli/internal/integrationtest" "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" - "golang.org/x/exp/slices" ) func TestCompileCoreCacheGeneration(t *testing.T) { diff --git a/internal/integrationtest/compile_4/compile_test.go b/internal/integrationtest/compile_4/compile_test.go index 07ba1f8e931..e3b207b863c 100644 --- a/internal/integrationtest/compile_4/compile_test.go +++ b/internal/integrationtest/compile_4/compile_test.go @@ -23,13 +23,13 @@ import ( "testing" "text/template" "time" + "slices" "github.com/arduino/arduino-cli/arduino/builder/cpp" "github.com/arduino/arduino-cli/internal/integrationtest" "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" "go.bug.st/testifyjson/requirejson" - "golang.org/x/exp/slices" ) func TestCompileOfProblematicSketches(t *testing.T) { From d063f307f90a5142ea6adcc51189071207262a68 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 16:53:50 +0200 Subject: [PATCH 03/13] us os instead of ioutil --- configuration/configuration_schema_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/configuration_schema_test.go b/configuration/configuration_schema_test.go index 5b153c9e09b..730189aa912 100644 --- a/configuration/configuration_schema_test.go +++ b/configuration/configuration_schema_test.go @@ -16,7 +16,7 @@ package configuration import ( - "io/ioutil" + "os" "testing" "github.com/stretchr/testify/require" @@ -24,7 +24,7 @@ import ( ) func TestConfigurationSchemaValidity(t *testing.T) { - schemaBytes, err := ioutil.ReadFile("configuration.schema.json") + schemaBytes, err := os.ReadFile("configuration.schema.json") require.NoError(t, err) jl := gojsonschema.NewBytesLoader(schemaBytes) From 24afb2dc6498599c9c05ac41bad3b18354b4f469 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 17:07:43 +0200 Subject: [PATCH 04/13] add space after comment // --- .../builder/preprocessor/internal/ctags/ctags_parser.go | 8 ++++---- arduino/libraries/loader.go | 2 +- commands/debug/debug_test.go | 4 ++-- internal/cli/arguments/post_install.go | 2 +- internal/cli/completion/completion.go | 2 +- internal/integrationtest/board/hardware_loading_test.go | 2 +- internal/integrationtest/core/core_test.go | 2 +- internal/integrationtest/outdated/outdated_test.go | 2 +- internal/integrationtest/upload/upload_test.go | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arduino/builder/preprocessor/internal/ctags/ctags_parser.go b/arduino/builder/preprocessor/internal/ctags/ctags_parser.go index c2e6e99585f..ddfe8580f1a 100644 --- a/arduino/builder/preprocessor/internal/ctags/ctags_parser.go +++ b/arduino/builder/preprocessor/internal/ctags/ctags_parser.go @@ -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" @@ -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 + ";" } @@ -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 @@ -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 diff --git a/arduino/libraries/loader.go b/arduino/libraries/loader.go index 2a106a37ae2..f278c85d40f 100644 --- a/arduino/libraries/loader.go +++ b/arduino/libraries/loader.go @@ -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 } diff --git a/commands/debug/debug_test.go b/commands/debug/debug_test.go index 5d9f91c8756..3304acded0b 100644 --- a/commands/debug/debug_test.go +++ b/commands/debug/debug_test.go @@ -66,7 +66,7 @@ func TestGetCommandLine(t *testing.T) { defer release() command, err := getCommandLine(req, pme) require.Nil(t, err) - commandToTest := strings.Join(command[:], " ") + commandToTest := strings.Join(command, " ") require.Equal(t, filepath.FromSlash(goldCommand), filepath.FromSlash(commandToTest)) // Other samd boards such as mkr1000 can be debugged using an external tool such as Atmel ICE connected to @@ -88,6 +88,6 @@ func TestGetCommandLine(t *testing.T) { command2, err := getCommandLine(req2, pme) assert.Nil(t, err) - commandToTest2 := strings.Join(command2[:], " ") + commandToTest2 := strings.Join(command2, " ") assert.Equal(t, filepath.FromSlash(goldCommand2), filepath.FromSlash(commandToTest2)) } diff --git a/internal/cli/arguments/post_install.go b/internal/cli/arguments/post_install.go index 1db4eb85645..a98f6dc982b 100644 --- a/internal/cli/arguments/post_install.go +++ b/internal/cli/arguments/post_install.go @@ -26,7 +26,7 @@ import ( // this information are consistent with each other. type PostInstallFlags struct { runPostInstall bool // force the execution of installation scripts - skipPostInstall bool //skip the execution of installation scripts + skipPostInstall bool // skip the execution of installation scripts } // AddToCommand adds flags that can be used to force running or skipping diff --git a/internal/cli/completion/completion.go b/internal/cli/completion/completion.go index 32b337eaf41..0dd05f8e315 100644 --- a/internal/cli/completion/completion.go +++ b/internal/cli/completion/completion.go @@ -25,7 +25,7 @@ import ( ) var ( - completionNoDesc bool //Disable completion description for shells that support it + completionNoDesc bool // Disable completion description for shells that support it tr = i18n.Tr ) diff --git a/internal/integrationtest/board/hardware_loading_test.go b/internal/integrationtest/board/hardware_loading_test.go index 05c650c7f0b..54bf8cffa14 100644 --- a/internal/integrationtest/board/hardware_loading_test.go +++ b/internal/integrationtest/board/hardware_loading_test.go @@ -151,7 +151,7 @@ func TestHardwareLoading(t *testing.T) { require.NoError(t, err) jsonOut := requirejson.Parse(t, out) if runtime.GOOS == "windows" { - //a package is a symlink, and windows does not support them + // a package is a symlink, and windows does not support them jsonOut.LengthMustEqualTo(2) } else { jsonOut.LengthMustEqualTo(3) diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 40742676fa5..ae4330b4b8a 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -1056,7 +1056,7 @@ func TestCoreUpgradeWarningWithPackageInstalledButNotIndexed(t *testing.T) { // install 3rd-party core outdated version _, _, err = cli.Run("core", "install", "test:x86@1.0.0", "--additional-urls="+url) require.NoError(t, err) - //upgrade without index fires a warning + // upgrade without index fires a warning jsonStdout, _, _ := cli.Run("core", "upgrade", "test:x86", "--format", "json") requirejson.Query(t, jsonStdout, ".warnings[]", `"missing package index for test:x86, future updates cannot be guaranteed"`) }) diff --git a/internal/integrationtest/outdated/outdated_test.go b/internal/integrationtest/outdated/outdated_test.go index 77f7c54bcd4..85773a838d0 100644 --- a/internal/integrationtest/outdated/outdated_test.go +++ b/internal/integrationtest/outdated/outdated_test.go @@ -27,7 +27,7 @@ func TestOutdated(t *testing.T) { env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) defer env.CleanUp() - //Updates index for cores and libraries + // Updates index for cores and libraries _, _, err := cli.Run("core", "update-index") require.NoError(t, err) _, _, err = cli.Run("lib", "update-index") diff --git a/internal/integrationtest/upload/upload_test.go b/internal/integrationtest/upload/upload_test.go index e81bb5e1562..7407c5af31e 100644 --- a/internal/integrationtest/upload/upload_test.go +++ b/internal/integrationtest/upload/upload_test.go @@ -41,7 +41,7 @@ type board struct { func detectedBoards(t *testing.T, cli *integrationtest.ArduinoCLI) []board { // This fixture provides a list of all the boards attached to the host. // This fixture will parse the JSON output of `arduino-cli board list --format json` - //to extract all the connected boards data. + // to extract all the connected boards data. // :returns a list `Board` objects. From a59679cd8bdaa85b388be219693025631a033056 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 17:33:26 +0200 Subject: [PATCH 05/13] use t.Setenv instead of os.Setenv in tests --- arduino/cores/packagemanager/package_manager_test.go | 2 +- commands/board/list_test.go | 3 +-- commands/core/search_test.go | 9 ++++----- internal/integrationtest/compile_3/core_caching_test.go | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arduino/cores/packagemanager/package_manager_test.go b/arduino/cores/packagemanager/package_manager_test.go index 7a6d8994004..92d064e65cf 100644 --- a/arduino/cores/packagemanager/package_manager_test.go +++ b/arduino/cores/packagemanager/package_manager_test.go @@ -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, diff --git a/commands/board/list_test.go b/commands/board/list_test.go index f99d942cf29..0f92e4c3896 100644 --- a/commands/board/list_test.go +++ b/commands/board/list_test.go @@ -19,7 +19,6 @@ import ( "fmt" "net/http" "net/http/httptest" - "os" "testing" "github.com/arduino/arduino-cli/arduino/cores/packagemanager" @@ -110,7 +109,7 @@ func TestBoardDetectionViaAPIWithNonUSBPort(t *testing.T) { func TestBoardIdentifySorting(t *testing.T) { dataDir := paths.TempDir().Join("test", "data_dir") - os.Setenv("ARDUINO_DATA_DIR", dataDir.String()) + t.Setenv("ARDUINO_DATA_DIR", dataDir.String()) dataDir.MkdirAll() defer paths.TempDir().Join("test").RemoveAll() diff --git a/commands/core/search_test.go b/commands/core/search_test.go index 2bbb027abf5..b96c19912af 100644 --- a/commands/core/search_test.go +++ b/commands/core/search_test.go @@ -16,7 +16,6 @@ package core import ( - "os" "testing" "github.com/arduino/arduino-cli/configuration" @@ -30,8 +29,8 @@ func TestPlatformSearch(t *testing.T) { dataDir := paths.TempDir().Join("test", "data_dir") downloadDir := paths.TempDir().Join("test", "staging") - os.Setenv("ARDUINO_DATA_DIR", dataDir.String()) - os.Setenv("ARDUINO_DOWNLOADS_DIR", downloadDir.String()) + t.Setenv("ARDUINO_DATA_DIR", dataDir.String()) + t.Setenv("ARDUINO_DOWNLOADS_DIR", downloadDir.String()) dataDir.MkdirAll() downloadDir.MkdirAll() defer paths.TempDir().Join("test").RemoveAll() @@ -323,8 +322,8 @@ func TestPlatformSearch(t *testing.T) { func TestPlatformSearchSorting(t *testing.T) { dataDir := paths.TempDir().Join("test", "data_dir") downloadDir := paths.TempDir().Join("test", "staging") - os.Setenv("ARDUINO_DATA_DIR", dataDir.String()) - os.Setenv("ARDUINO_DOWNLOADS_DIR", downloadDir.String()) + t.Setenv("ARDUINO_DATA_DIR", dataDir.String()) + t.Setenv("ARDUINO_DOWNLOADS_DIR", downloadDir.String()) dataDir.MkdirAll() downloadDir.MkdirAll() defer paths.TempDir().Join("test").RemoveAll() diff --git a/internal/integrationtest/compile_3/core_caching_test.go b/internal/integrationtest/compile_3/core_caching_test.go index d64129ccc8f..4af201012bc 100644 --- a/internal/integrationtest/compile_3/core_caching_test.go +++ b/internal/integrationtest/compile_3/core_caching_test.go @@ -16,9 +16,9 @@ package compile_test import ( + "slices" "strings" "testing" - "slices" "github.com/arduino/arduino-cli/internal/integrationtest" "github.com/arduino/go-paths-helper" From 3fe22271597294fc05404f4aac976d632bf0222d Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:17:20 +0200 Subject: [PATCH 06/13] update DistTask --- DistTasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DistTasks.yml b/DistTasks.yml index af5536e9e8a..2231c439dc7 100644 --- a/DistTasks.yml +++ b/DistTasks.yml @@ -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: From 3ac73357f898d44e76b86f5febcda7ac1caa3205 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:17:31 +0200 Subject: [PATCH 07/13] update GH workflows --- .github/workflows/check-easyjson.yml | 2 +- .github/workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/check-go-task.yml | 2 +- .github/workflows/check-i18n-task.yml | 2 +- .github/workflows/check-markdown-task.yml | 2 +- .github/workflows/check-mkdocs-task.yml | 2 +- .github/workflows/check-protobuf-task.yml | 2 +- .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml | 2 +- .github/workflows/i18n-weekly-pull.yaml | 2 +- .github/workflows/test-go-task.yml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check-easyjson.yml b/.github/workflows/check-easyjson.yml index 6468c8b0f5a..89051e5b6da 100644 --- a/.github/workflows/check-easyjson.yml +++ b/.github/workflows/check-easyjson.yml @@ -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: diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 35aa3e9b6dd..f2013d855e2 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -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: diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index 75beba97f85..2521a6af2d2 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -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: diff --git a/.github/workflows/check-i18n-task.yml b/.github/workflows/check-i18n-task.yml index 1fc67b05620..659f6e4a92c 100644 --- a/.github/workflows/check-i18n-task.yml +++ b/.github/workflows/check-i18n-task.yml @@ -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: diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 0839c02fd44..12dd65d6c2c 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -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: diff --git a/.github/workflows/check-mkdocs-task.yml b/.github/workflows/check-mkdocs-task.yml index 0b01cf0c37a..6914212a928 100644 --- a/.github/workflows/check-mkdocs-task.yml +++ b/.github/workflows/check-mkdocs-task.yml @@ -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" diff --git a/.github/workflows/check-protobuf-task.yml b/.github/workflows/check-protobuf-task.yml index 19196c0113e..6dabcc443ff 100644 --- a/.github/workflows/check-protobuf-task.yml +++ b/.github/workflows/check-protobuf-task.yml @@ -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: diff --git a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml index 08a523e624f..1f8902be25b 100644 --- a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml +++ b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml @@ -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" diff --git a/.github/workflows/i18n-weekly-pull.yaml b/.github/workflows/i18n-weekly-pull.yaml index 1d6c0f7deca..1aac744870a 100644 --- a/.github/workflows/i18n-weekly-pull.yaml +++ b/.github/workflows/i18n-weekly-pull.yaml @@ -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: diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index e11c59ba91e..4b4c2865a4c 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -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 From dec3d912a80a4a8265435b16ca75d87c01cdccd8 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:17:37 +0200 Subject: [PATCH 08/13] update docs --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 84cd56b7585..50f55be7d00 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -70,7 +70,7 @@ submitting a PR: To build the Arduino CLI from sources you need the following tools to be available in your local environment: -- [Go][1] version 1.20 or later +- [Go][1] version 1.21 or later - [Taskfile][2] to help you run the most common tasks from the command line If you want to run integration tests you will also need: From 684579553d4c3f4fc555d2e2a7175708ebd8b0bb Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:21:05 +0200 Subject: [PATCH 09/13] regenerare dep licenes --- .../gofrs/{uuid.dep.yml => uuid/v5.dep.yml} | 8 +-- .../go/golang.org/x/exp/constraints.dep.yml | 63 ------------------- .licenses/go/golang.org/x/exp/slices.dep.yml | 62 ------------------ 3 files changed, 4 insertions(+), 129 deletions(-) rename .licenses/go/github.com/gofrs/{uuid.dep.yml => uuid/v5.dep.yml} (89%) delete mode 100644 .licenses/go/golang.org/x/exp/constraints.dep.yml delete mode 100644 .licenses/go/golang.org/x/exp/slices.dep.yml diff --git a/.licenses/go/github.com/gofrs/uuid.dep.yml b/.licenses/go/github.com/gofrs/uuid/v5.dep.yml similarity index 89% rename from .licenses/go/github.com/gofrs/uuid.dep.yml rename to .licenses/go/github.com/gofrs/uuid/v5.dep.yml index 2e15a71f717..06b74d71a62 100644 --- a/.licenses/go/github.com/gofrs/uuid.dep.yml +++ b/.licenses/go/github.com/gofrs/uuid/v5.dep.yml @@ -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 diff --git a/.licenses/go/golang.org/x/exp/constraints.dep.yml b/.licenses/go/golang.org/x/exp/constraints.dep.yml deleted file mode 100644 index 14cd0ef4868..00000000000 --- a/.licenses/go/golang.org/x/exp/constraints.dep.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -name: golang.org/x/exp/constraints -version: v0.0.0-20230321023759-10a507213a29 -type: go -summary: Package constraints defines a set of useful constraints to be used with type - parameters. -homepage: https://pkg.go.dev/golang.org/x/exp/constraints -license: bsd-3-clause -licenses: -- sources: exp@v0.0.0-20230321023759-10a507213a29/LICENSE - text: | - Copyright (c) 2009 The Go Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: exp@v0.0.0-20230321023759-10a507213a29/PATENTS - text: | - Additional IP Rights Grant (Patents) - - "This implementation" means the copyrightable works distributed by - Google as part of the Go project. - - Google hereby grants to You a perpetual, worldwide, non-exclusive, - no-charge, royalty-free, irrevocable (except as stated in this section) - patent license to make, have made, use, offer to sell, sell, import, - transfer and otherwise run, modify and propagate the contents of this - implementation of Go, where such license applies only to those patent - claims, both currently owned or controlled by Google and acquired in - the future, licensable by Google that are necessarily infringed by this - implementation of Go. This grant does not include claims that would be - infringed only as a consequence of further modification of this - implementation. If you or your agent or exclusive licensee institute or - order or agree to the institution of patent litigation against any - entity (including a cross-claim or counterclaim in a lawsuit) alleging - that this implementation of Go or any code incorporated within this - implementation of Go constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any patent - rights granted to you under this License for this implementation of Go - shall terminate as of the date such litigation is filed. -notices: [] diff --git a/.licenses/go/golang.org/x/exp/slices.dep.yml b/.licenses/go/golang.org/x/exp/slices.dep.yml deleted file mode 100644 index 8fca8863335..00000000000 --- a/.licenses/go/golang.org/x/exp/slices.dep.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: golang.org/x/exp/slices -version: v0.0.0-20230321023759-10a507213a29 -type: go -summary: Package slices defines various functions useful with slices of any type. -homepage: https://pkg.go.dev/golang.org/x/exp/slices -license: bsd-3-clause -licenses: -- sources: exp@v0.0.0-20230321023759-10a507213a29/LICENSE - text: | - Copyright (c) 2009 The Go Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: exp@v0.0.0-20230321023759-10a507213a29/PATENTS - text: | - Additional IP Rights Grant (Patents) - - "This implementation" means the copyrightable works distributed by - Google as part of the Go project. - - Google hereby grants to You a perpetual, worldwide, non-exclusive, - no-charge, royalty-free, irrevocable (except as stated in this section) - patent license to make, have made, use, offer to sell, sell, import, - transfer and otherwise run, modify and propagate the contents of this - implementation of Go, where such license applies only to those patent - claims, both currently owned or controlled by Google and acquired in - the future, licensable by Google that are necessarily infringed by this - implementation of Go. This grant does not include claims that would be - infringed only as a consequence of further modification of this - implementation. If you or your agent or exclusive licensee institute or - order or agree to the institution of patent litigation against any - entity (including a cross-claim or counterclaim in a lawsuit) alleging - that this implementation of Go or any code incorporated within this - implementation of Go constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any patent - rights granted to you under this License for this implementation of Go - shall terminate as of the date such litigation is filed. -notices: [] From 522f2f1c90cbda51759332a7eea858a65d77e3a2 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:26:54 +0200 Subject: [PATCH 10/13] fix test --- internal/integrationtest/compile_4/compile_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/integrationtest/compile_4/compile_test.go b/internal/integrationtest/compile_4/compile_test.go index e3b207b863c..29979a93fb0 100644 --- a/internal/integrationtest/compile_4/compile_test.go +++ b/internal/integrationtest/compile_4/compile_test.go @@ -17,13 +17,14 @@ package compile_test import ( "bytes" + "cmp" "encoding/json" "os/exec" + "slices" "strings" "testing" "text/template" "time" - "slices" "github.com/arduino/arduino-cli/arduino/builder/cpp" "github.com/arduino/arduino-cli/internal/integrationtest" @@ -176,7 +177,7 @@ func testBuilderSketchWithSubfolders(t *testing.T, env *integrationtest.Environm // Build out, err := tryBuild(t, env, cli, "arduino:avr:leonardo") importedLibraries := out.BuilderResult.UsedLibraries - slices.SortFunc(importedLibraries, func(x, y *builderLibrary) bool { return x.Name < y.Name }) + slices.SortFunc(importedLibraries, func(x, y *builderLibrary) int { return cmp.Compare(x.Name, y.Name) }) require.NoError(t, err) require.Equal(t, 3, len(importedLibraries)) require.Equal(t, "testlib1", importedLibraries[0].Name) @@ -570,7 +571,11 @@ func testBuilderSketchWithConflictingLibraries(t *testing.T, env *integrationtes out, err := tryBuild(t, env, cli, "arduino:avr:leonardo") require.NoError(t, err) libs := out.BuilderResult.UsedLibraries - slices.SortFunc(libs, func(x, y *builderLibrary) bool { return x.Name < y.Name }) + + // SortFunc sorts the slice x in ascending order as determined by the cmp function. + // This sort is not guaranteed to be stable. cmp(a, b) should return a negative number when a \< b, + // a positive number when a > b and zero when a == b. + slices.SortFunc(libs, func(x, y *builderLibrary) int { return cmp.Compare(x.Name, y.Name) }) require.Len(t, libs, 2) require.Equal(t, "Bridge", libs[0].Name) require.Equal(t, "IRremote", libs[1].Name) @@ -583,7 +588,7 @@ func testBuilderSketchLibraryProvidesAllIncludes(t *testing.T, env *integrationt out, err := tryBuild(t, env, cli, "arduino:avr:leonardo") require.NoError(t, err) libs := out.BuilderResult.UsedLibraries - slices.SortFunc(libs, func(x, y *builderLibrary) bool { return x.Name < y.Name }) + slices.SortFunc(libs, func(x, y *builderLibrary) int { return cmp.Compare(x.Name, y.Name) }) require.Len(t, libs, 2) require.Equal(t, "ANewLibrary-master", libs[0].Name) require.Equal(t, "IRremote", libs[1].Name) From 0b296d0670f168fb2986d19e616ce5a944cf98ad Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:30:51 +0200 Subject: [PATCH 11/13] use strings.ReplaceAll instead of Replace with -1 --- arduino/builder/cpp/cpp.go | 4 ++-- arduino/builder/preprocessor/ctags.go | 4 ++-- arduino/builder/preprocessor/internal/ctags/ctags_parser.go | 6 +++--- commands/compile/compile.go | 2 +- i18n/convert.go | 4 ++-- internal/cli/lib/search.go | 2 +- internal/integrationtest/compile_4/compile_test.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arduino/builder/cpp/cpp.go b/arduino/builder/cpp/cpp.go index 53123434fe1..bed3ce542e1 100644 --- a/arduino/builder/cpp/cpp.go +++ b/arduino/builder/cpp/cpp.go @@ -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 + "\"" } diff --git a/arduino/builder/preprocessor/ctags.go b/arduino/builder/preprocessor/ctags.go index bf5f25b4ca2..8d9fb7c9480 100644 --- a/arduino/builder/preprocessor/ctags.go +++ b/arduino/builder/preprocessor/ctags.go @@ -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 diff --git a/arduino/builder/preprocessor/internal/ctags/ctags_parser.go b/arduino/builder/preprocessor/internal/ctags/ctags_parser.go index ddfe8580f1a..0403852143f 100644 --- a/arduino/builder/preprocessor/internal/ctags/ctags_parser.go +++ b/arduino/builder/preprocessor/internal/ctags/ctags_parser.go @@ -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 } @@ -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:] diff --git a/commands/compile/compile.go b/commands/compile/compile.go index cd728eb5fa1..5a21f50518c 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -310,7 +310,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream exportPath = paths.New(exportDir) } else { // Add FQBN (without configs part) to export path - fqbnSuffix := strings.Replace(fqbn.StringWithoutConfig(), ":", ".", -1) + fqbnSuffix := strings.ReplaceAll(fqbn.StringWithoutConfig(), ":", ".") exportPath = sk.FullPath.Join("build", fqbnSuffix) } logrus.WithField("path", exportPath).Trace("Saving sketch to export path.") diff --git a/i18n/convert.go b/i18n/convert.go index 287b43f308a..7b6d2e8dbdf 100644 --- a/i18n/convert.go +++ b/i18n/convert.go @@ -34,11 +34,11 @@ func FromJavaToGoSyntax(s string) string { if err != nil { panic(err) } - s = strings.Replace(s, submatch[0], "%["+strconv.Itoa(idx+1)+"]v", -1) + s = strings.ReplaceAll(s, submatch[0], "%["+strconv.Itoa(idx+1)+"]v") } // Replace "''" => "'" - s = strings.Replace(s, "''", "'", -1) + s = strings.ReplaceAll(s, "''", "'") return s } diff --git a/internal/cli/lib/search.go b/internal/cli/lib/search.go index 2f62d5cad92..c44ced3778b 100644 --- a/internal/cli/lib/search.go +++ b/internal/cli/lib/search.go @@ -163,7 +163,7 @@ func (res result) String() string { out.WriteString(fmt.Sprintf(" "+tr("Category: %s")+"\n", latest.Category)) out.WriteString(fmt.Sprintf(" "+tr("Architecture: %s")+"\n", strings.Join(latest.Architectures, ", "))) out.WriteString(fmt.Sprintf(" "+tr("Types: %s")+"\n", strings.Join(latest.Types, ", "))) - out.WriteString(fmt.Sprintf(" "+tr("Versions: %s")+"\n", strings.Replace(fmt.Sprint(lib.GetAvailableVersions()), " ", ", ", -1))) + out.WriteString(fmt.Sprintf(" "+tr("Versions: %s")+"\n", strings.ReplaceAll(fmt.Sprint(lib.GetAvailableVersions()), " ", ", "))) if len(latest.ProvidesIncludes) > 0 { out.WriteString(fmt.Sprintf(" "+tr("Provides includes: %s")+"\n", strings.Join(latest.ProvidesIncludes, ", "))) } diff --git a/internal/integrationtest/compile_4/compile_test.go b/internal/integrationtest/compile_4/compile_test.go index 29979a93fb0..878025a4e84 100644 --- a/internal/integrationtest/compile_4/compile_test.go +++ b/internal/integrationtest/compile_4/compile_test.go @@ -904,7 +904,7 @@ func comparePreprocessGoldenFile(t *testing.T, sketchDir *paths.Path, preprocess err = tpl.Execute(&buf, data) require.NoError(t, err) - require.Equal(t, buf.String(), strings.Replace(preprocessedSketch, "\r\n", "\n", -1)) + require.Equal(t, buf.String(), strings.ReplaceAll(preprocessedSketch, "\r\n", "\n")) } func TestCoreCaching(t *testing.T) { From efd42ebcd105c1639ab11210c82a7620be1d89df Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 14 Sep 2023 18:31:52 +0200 Subject: [PATCH 12/13] go mod tidy --- go.mod | 21 +++++++++------------ go.sum | 19 ++++++++++++------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 1f0c629c8e5..8f32def16e9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/arduino/arduino-cli -go 1.20 +go 1.21 // We must use this fork until https://github.com/mailru/easyjson/pull/372 is merged replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1 @@ -24,33 +24,27 @@ require ( github.com/pkg/errors v0.9.1 github.com/pmylund/sortutil v0.0.0-20120526081524-abeda66eb583 github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 + github.com/rogpeppe/go-internal v1.3.0 github.com/schollz/closestmatch v2.1.0+incompatible - github.com/sergi/go-diff v1.1.0 // indirect github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v1.2.1 github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.8.0 + github.com/xeipuuv/gojsonschema v1.2.0 go.bug.st/cleanup v1.0.0 go.bug.st/downloader/v2 v2.1.1 go.bug.st/relaxed-semver v0.10.2 go.bug.st/serial v1.3.2 + go.bug.st/testifyjson v1.1.1 golang.org/x/crypto v0.7.0 + golang.org/x/term v0.6.0 golang.org/x/text v0.8.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e google.golang.org/grpc v1.55.0 google.golang.org/protobuf v1.30.0 - gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v2 v2.4.0 -) - -require ( - github.com/rogpeppe/go-internal v1.3.0 - github.com/xeipuuv/gojsonschema v1.2.0 - go.bug.st/testifyjson v1.1.1 - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 - golang.org/x/term v0.6.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e gopkg.in/yaml.v3 v3.0.1 ) @@ -69,6 +63,7 @@ require ( github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 // indirect + github.com/juju/loggo v1.0.0 // indirect github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect github.com/klauspost/compress v1.15.13 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect @@ -80,6 +75,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/sergi/go-diff v1.1.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/afero v1.6.0 // indirect github.com/spf13/cast v1.3.1 // indirect @@ -93,6 +89,7 @@ require ( golang.org/x/net v0.8.0 // indirect golang.org/x/sys v0.6.0 // indirect gopkg.in/ini.v1 v1.62.0 // indirect + gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 741ba933e94..b1616787e00 100644 --- a/go.sum +++ b/go.sum @@ -81,7 +81,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0= github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -158,6 +157,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -221,11 +221,13 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI= -github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v1.0.0 h1:Y6ZMQOGR9Aj3BGkiWx7HBbIx6zNwNkxhVNOHU2i1bl0= +github.com/juju/loggo v1.0.0/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0 h1:+WWUkhnTjV6RNOxkcwk79qrjeyHEHvBzlneueBsatX4= +github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -238,18 +240,20 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys= github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us= +github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84 h1:hyAgCuG5nqTMDeUD8KZs7HSPs6KprPgPP8QmGV8nyvk= github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84/go.mod h1:Pb6XcsXyropB9LNHhnqaknG/vEwYztLkQzVCHv8sQ3M= +github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= @@ -272,6 +276,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= @@ -398,8 +403,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -715,9 +718,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From da4697eba2b81c161bc6d1cad6d1564e48664f02 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Fri, 15 Sep 2023 11:02:59 +0200 Subject: [PATCH 13/13] remove godoc comment commit by mistake --- internal/integrationtest/compile_4/compile_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/integrationtest/compile_4/compile_test.go b/internal/integrationtest/compile_4/compile_test.go index 878025a4e84..a61d68563a5 100644 --- a/internal/integrationtest/compile_4/compile_test.go +++ b/internal/integrationtest/compile_4/compile_test.go @@ -572,9 +572,6 @@ func testBuilderSketchWithConflictingLibraries(t *testing.T, env *integrationtes require.NoError(t, err) libs := out.BuilderResult.UsedLibraries - // SortFunc sorts the slice x in ascending order as determined by the cmp function. - // This sort is not guaranteed to be stable. cmp(a, b) should return a negative number when a \< b, - // a positive number when a > b and zero when a == b. slices.SortFunc(libs, func(x, y *builderLibrary) int { return cmp.Compare(x.Name, y.Name) }) require.Len(t, libs, 2) require.Equal(t, "Bridge", libs[0].Name)