Skip to content

Commit

Permalink
Bump Go to 1.18.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.
Update dependencies to work with Go 1.18,
including backport of hyperledger#2338.

Signed-off-by: David Enyeart <[email protected]>
  • Loading branch information
denyeart committed May 20, 2022
1 parent 8be2067 commit 0f106ed
Show file tree
Hide file tree
Showing 1,073 changed files with 123,456 additions and 126,178 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
19 changes: 5 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,34 @@ module github.com/hyperledger/fabric

go 1.14

// https://github.com/golang/go/issues/34610
replace golang.org/x/sys => golang.org/x/sys v0.0.0-20190920190810-ef0ce1748380

require (
code.cloudfoundry.org/clock v1.0.0
github.com/DataDog/zstd v1.4.0 // indirect
github.com/Knetic/govaluate v3.0.0+incompatible
github.com/Microsoft/hcsshim v0.8.6 // indirect
github.com/Shopify/sarama v1.20.1
github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect
github.com/VictoriaMetrics/fastcache v1.5.7
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc // indirect
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea // indirect
github.com/davecgh/go-spew v1.1.1
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v17.12.0-ce-rc1.0.20190628135806-70f67c6240bb+incompatible // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/frankban/quicktest v1.9.0 // indirect
github.com/fsouza/go-dockerclient v1.4.1
github.com/fsouza/go-dockerclient v1.7.0
github.com/go-kit/kit v0.8.0
github.com/golang/protobuf v1.3.3
github.com/golang/snappy v0.0.2 // indirect
github.com/google/go-cmp v0.5.0 // indirect
github.com/gorilla/handlers v1.4.0
github.com/gorilla/mux v1.7.2
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/hashicorp/go-version v1.2.0
github.com/hyperledger/fabric-amcl v0.0.0-20200128223036-d1aa2665426a
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200128192331-2d899240a7ed
github.com/hyperledger/fabric-config v0.0.7
github.com/hyperledger/fabric-lib-go v1.0.0
github.com/hyperledger/fabric-protos-go v0.0.0-20200506201313-25f6564b9ac4
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kr/pretty v0.2.0
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect
Expand All @@ -64,8 +54,9 @@ require (
github.com/willf/bitset v1.1.10
go.etcd.io/etcd v0.5.0-alpha.5.0.20181228115726-23731bf9ba55
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/tools v0.0.0-20200131233409-575de47986ce
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/tools v0.1.10
google.golang.org/grpc v1.29.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/cheggaaa/pb.v1 v1.0.28
Expand Down
Loading

0 comments on commit 0f106ed

Please sign in to comment.