From f8c543cae24138cafe400342319d098041d552cf Mon Sep 17 00:00:00 2001 From: Cosmos Nicolaou Date: Sun, 6 Oct 2024 19:44:29 -0700 Subject: [PATCH 1/2] update dependencies, go 1.23 --- .github/workflows/codeql.yml | 8 ++++++++ .github/workflows/linux.yml | 4 ++-- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- go.mod | 6 +++--- go.sum | 6 ++++++ 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c83d2e8..6f0b2ac 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -38,6 +38,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + # Workaround for Go 1.21 compatibility. + # TODO: Remove when GitHub Action runners Support Go 1.21+. + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + cache: false + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 831dd21..a8ffa4a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - go-version: [1.21.x, 1.22.x] + go-version: [1.22.x, 1.23.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: @@ -42,7 +42,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.x + go-version: 1.23.x cache: true cache-dependency-path: github.com/vanadium/go.lib/go.sum diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 09faee1..fbb98fa 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - go-version: [1.20.x, 1.22.x] + go-version: [1.22.x, 1.23.x] os: [macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 189526e..adcb61d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - go-version: [1.22.x] + go-version: [1.23.x] os: [windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/go.mod b/go.mod index 852e517..a3be48f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/spf13/pflag v1.0.5 - golang.org/x/crypto v0.22.0 - golang.org/x/net v0.24.0 - golang.org/x/sys v0.19.0 + golang.org/x/crypto v0.28.0 + golang.org/x/net v0.30.0 + golang.org/x/sys v0.26.0 ) diff --git a/go.sum b/go.sum index 63100bd..0a4023b 100644 --- a/go.sum +++ b/go.sum @@ -21,6 +21,8 @@ golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -43,6 +45,8 @@ golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -67,6 +71,8 @@ golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From ed62ea1bcaee155fd2ce047f99cc9df643450b83 Mon Sep 17 00:00:00 2001 From: Cosmos Nicolaou Date: Mon, 7 Oct 2024 09:33:27 -0700 Subject: [PATCH 2/2] . --- .golangci.yml | 2 +- cmdline/gendoc/gendoc.go | 2 +- cmdline/help.go | 9 ++++----- nsync/cv_timeout_stress_test.go | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0a2c8a2..4a2a15d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,7 @@ linters: - govet - ineffassign - misspell - - exportloopref + - copyloopvar - staticcheck - typecheck - unconvert diff --git a/cmdline/gendoc/gendoc.go b/cmdline/gendoc/gendoc.go index 08e7183..a7a38b6 100644 --- a/cmdline/gendoc/gendoc.go +++ b/cmdline/gendoc/gendoc.go @@ -154,7 +154,7 @@ func writeOutput(out string, runGoFmt bool) error { tagsConstraint = fmt.Sprintf("// +build %s\n\n", flagTags) } - copyright := `// Copyright 2022 The Vanadium Authors. All rights reserved. + copyright := `// Copyright 2024 The Vanadium Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmdline/help.go b/cmdline/help.go index 83e4b4f..aa10eeb 100644 --- a/cmdline/help.go +++ b/cmdline/help.go @@ -8,7 +8,7 @@ import ( "bytes" "flag" "fmt" - "go/doc" + "go/doc/comment" "io" "path/filepath" "regexp" @@ -165,12 +165,11 @@ func godocHeader(path, short string) string { // We try our best to create a header that includes both the command path and // the short description, but if godoc won't extract a header out of the line, // we fall back to just returning the command path. - // - // For more details see the comments and implementation of doc.ToHTML: - // http://golang.org/pkg/go/doc/#ToHTML header := firstRuneToUpper(path + " - " + short) var buf bytes.Buffer - doc.ToHTML(&buf, "before\n\n"+header+"\n\nafter", nil) + var p comment.Parser + d := p.Parse("before\n\n" + header + "\n\nafter") + buf.Write(new(comment.Printer).HTML(d)) if !bytes.Contains(buf.Bytes(), []byte("