Skip to content

Commit

Permalink
bump Go to 1.18.2 (release-2.2)
Browse files Browse the repository at this point in the history
Fix code issues from the updated staticcheck.
Fix unit test for new TLS messages and assertion changes in Go 1.18.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed May 26, 2022
1 parent b17d01a commit 61561dd
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ METADATA_VAR += CommitSHA=$(EXTRA_VERSION)
METADATA_VAR += BaseDockerLabel=$(BASE_DOCKER_LABEL)
METADATA_VAR += DockerNamespace=$(DOCKER_NS)

GO_VER = 1.17.5
GO_VER = 1.18.2
GO_TAGS ?=

RELEASE_EXES = orderer $(TOOLS_EXES)
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pr: none
variables:
GOPATH: $(Agent.BuildDirectory)/go
PATH: $(Agent.BuildDirectory)/go/bin:/usr/local/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.17.5
GOVER: 1.18.2

jobs:
- job: UnitTests
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
- name: GOPATH
value: $(Agent.BuildDirectory)/go
- name: GOVER
value: 1.17.5
value: 1.18.2

stages:
- stage: BuildBinaries
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pr:
variables:
GOPATH: $(Agent.BuildDirectory)/go
PATH: $(Agent.BuildDirectory)/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.17.5
GOVER: 1.18.2

stages:
- stage: VerifyBuild
Expand Down
4 changes: 3 additions & 1 deletion common/grpclogging/fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ var _ = Describe("Fields", func() {
field := grpclogging.Error(err)
Expect(field.Key).To(Equal("error"))
Expect(field.Type).To(Equal(zapcore.ErrorType))
Expect(field.Interface).To(Equal(struct{ error }{err}))
// assert that field Interface is of type error
_, ok := field.Interface.(error)
Expect(ok).To(BeTrue())
})

Context("when the error is nil", func() {
Expand Down
2 changes: 1 addition & 1 deletion common/ledger/testutil/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var signer msp.SigningIdentity

func init() {
// setup the MSP manager so that we can sign/verify
var err error = msptesttools.LoadMSPSetupForTesting()
err := msptesttools.LoadMSPSetupForTesting()
if err != nil {
panic(fmt.Errorf("Could not load msp config, err %s", err))
}
Expand Down
2 changes: 1 addition & 1 deletion common/policydsl/policyparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func secondPass(args ...interface{}) (interface{}, error) {
}

/* get the n in the t out of n */
var n int = len(args) - 2
n := len(args) - 2

/* sanity check - t should be positive, permit equal to n+1, but disallow over n+1 */
if t < 0 || t > n+1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ func (dbclient *couchDatabase) listIndex() ([]*indexResult, error) {
designDoc = s[1]

//Add the index definition to the results
var addIndexResult = &indexResult{DesignDocument: designDoc, Name: row.Name, Definition: fmt.Sprintf("%s", row.Definition)}
var addIndexResult = &indexResult{DesignDocument: designDoc, Name: row.Name, Definition: string(row.Definition)}
results = append(results, addIndexResult)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev-setup/devenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Prerequisites
~~~~~~~~~~~~~

- `Git client <https://git-scm.com/downloads>`__
- `Go <https://golang.org/dl/>`__ version 1.17.x
- `Go <https://golang.org/dl/>`__ version 1.18.x
- `Docker <https://docs.docker.com/get-docker/>`__ version 18.03 or later
- (macOS) `Xcode Command Line Tools <https://developer.apple.com/downloads/>`__
- `SoftHSM <https://github.com/opendnssec/SoftHSMv2>`__
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ func TestSendByCriteria(t *testing.T) {
if msg == nil {
return
}
t.Fatalf("%d got a message, but shouldn't have!", peerId)
t.Errorf("%d got a message, but shouldn't have!", peerId)
}
g2Endpoint := fmt.Sprintf("127.0.0.1:%d", port1)
g3Endpoint := fmt.Sprintf("127.0.0.1:%d", port2)
Expand Down
2 changes: 1 addition & 1 deletion integration/nwo/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (c *Components) Build(path string) string {
Expect(err).NotTo(HaveOccurred())

if resp.StatusCode != http.StatusOK {
Expect(resp.StatusCode).To(Equal(http.StatusOK), fmt.Sprintf("%s", body))
Expect(resp.StatusCode).To(Equal(http.StatusOK), string(body))
}

return string(body)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/comm/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestCreds(t *testing.T) {
MaxVersion: tls.VersionTLS10,
})
wg.Wait()
require.Contains(t, err.Error(), "protocol version not supported")
require.Contains(t, err.Error(), "tls: no supported versions satisfy MinVersion and MaxVersion")
require.Contains(t, recorder.Messages()[1], "TLS handshake failed")
}

Expand Down
2 changes: 1 addition & 1 deletion vagrant/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

GOROOT='/opt/go'
GO_VERSION=1.17.5
GO_VERSION=1.18.2

# ----------------------------------------------------------------
# Install Golang
Expand Down

0 comments on commit 61561dd

Please sign in to comment.