Skip to content

Commit

Permalink
Bump Go to 1.17.8
Browse files Browse the repository at this point in the history
Changes with Go 1.17
- gofmt produces 1.17 build tag format
- go 1.17 directive in go.mod causes second require stanza for indirect dependencies
- go.mod and go.sum removed from vendored dependencies
- update unit tests to reflect Go 1.17 changes

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed Mar 23, 2022
1 parent 077518e commit c025d5e
Show file tree
Hide file tree
Showing 68 changed files with 117 additions and 733 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PKGNAME = github.com/hyperledger/$(PROJECT_NAME)

METADATA_VAR = Version=$(PROJECT_VERSION)

GO_VER = 1.16.7
GO_VER = 1.17.8
GO_SOURCE := $(shell find . -name '*.go')
GO_LDFLAGS = $(patsubst %,-X $(PKGNAME)/lib/metadata.%,$(METADATA_VAR))
export GO_LDFLAGS
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ See [User's Guide for Fabric CA](https://hyperledger-fabric-ca.readthedocs.io) f

## Prerequisites

* Go 1.16+ installation or later
* Go 1.17+ installation or later
* **GOPATH** environment variable is set correctly
* docker version 17.03 or later
* docker-compose version 1.11 or later
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.16.7
value: 1.17.8

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:$(Agent.BuildDirectory)/go/src/github.com/hyperledger/fabric-ca/build/tools:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.16.7
GOVER: 1.17.8

jobs:
- job: VerifyBuild
Expand Down
57 changes: 45 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
module github.com/hyperledger/fabric-ca

go 1.15
go 1.17

require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cloudflare/cfssl v1.4.1
github.com/felixge/httpsnoop v1.0.1
github.com/go-kit/kit v0.7.0
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-sql-driver/mysql v1.5.0
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang/protobuf v1.4.3
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
Expand All @@ -22,30 +18,67 @@ require (
github.com/jmoiron/sqlx v1.2.0
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46
github.com/lib/pq v1.8.0
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-sqlite3 v1.14.5
github.com/miekg/pkcs11 v1.0.3 // indirect
github.com/mitchellh/mapstructure v1.3.3
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.3
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.5.0
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.3.2
github.com/stretchr/testify v1.6.1
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9
gopkg.in/ldap.v2 v2.5.1
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/google/certificate-transparency-go v1.0.21 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmhodges/clock v0.0.0-20160418191101-880ee4c33548 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/pkcs11 v1.0.3 // indirect
github.com/nxadm/tail v1.4.4 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/stretchr/objx v0.1.1 // indirect
github.com/sykesm/zap-logfmt v0.0.4 // indirect
github.com/weppos/publicsuffix-go v0.5.0 // indirect
github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e // indirect
github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb // indirect
go.uber.org/atomic v1.5.0 // indirect
go.uber.org/multierr v1.3.0 // indirect
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect
go.uber.org/zap v1.13.0 // indirect
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 // indirect
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
google.golang.org/grpc v1.26.0 // indirect
google.golang.org/protobuf v1.23.0 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ldap.v2 v2.5.1
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
honnef.co/go/tools v0.0.1-2019.2.3 // indirect
)
1 change: 1 addition & 0 deletions internal/pkg/util/configurebccsp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build pkcs11
// +build pkcs11

/*
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/util/configurebccsp_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build pkcs11
// +build pkcs11

/*
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/util/configurebccspnopkcs11.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !pkcs11
// +build !pkcs11

/*
Expand Down
1 change: 1 addition & 0 deletions lib/capkcs11_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build pkcs11
// +build pkcs11

/*
Expand Down
11 changes: 4 additions & 7 deletions lib/client_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/cloudflare/cfssl/signer"
"github.com/hyperledger/fabric-ca/internal/pkg/api"
"github.com/hyperledger/fabric-ca/internal/pkg/util"
cax509 "github.com/hyperledger/fabric-ca/lib/client/credential/x509"
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/factory"
cspsigner "github.com/hyperledger/fabric/bccsp/signer"
Expand Down Expand Up @@ -297,13 +296,11 @@ func testImpersonation(id *Identity, t *testing.T) {
if err != nil {
t.Fatalf("Failed converting raw to ECDSA.PublicKey [%s]", err)
}
fakeCertBytes, err := x509.CreateCertificate(rand.Reader, cert, cert, pub, cspSigner)
if err != nil {
t.Fatalf("Failed to create self-signed fake cert: %s", err)
}
_, err = cax509.NewSigner(privateKey, fakeCertBytes)

//As of Go 1.17, CreateCertificate now returns an error if the provided private key doesn't match the parent's public key, if any.
_, err = x509.CreateCertificate(rand.Reader, cert, cert, pub, cspSigner)
if err == nil {
t.Fatalf("Should have failed to create signer with fake certificate")
t.Fatalf("Should have failed to create self-signed fake cert")
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/keyrequest.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build pkcs11
// +build pkcs11

/*
Expand Down
1 change: 1 addition & 0 deletions lib/keyrequestnopkcs11.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !pkcs11
// +build !pkcs11

/*
Expand Down
1 change: 1 addition & 0 deletions lib/server/db/sqlite/driver.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !caclient
// +build !caclient

/*
Expand Down
1 change: 1 addition & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build tools
// +build tools

/*
Expand Down
3 changes: 0 additions & 3 deletions vendor/github.com/felixge/httpsnoop/go.mod

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/fsnotify/fsnotify/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/fsnotify/fsnotify/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/go-logfmt/logfmt/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/go-sql-driver/mysql/go.mod

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/go-stack/stack/go.mod

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/gorilla/handlers/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/gorilla/handlers/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/gorilla/mux/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/hashicorp/hcl/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/hashicorp/hcl/go.sum

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/github.com/jmoiron/sqlx/go.mod

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/github.com/jmoiron/sqlx/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/lib/pq/go.mod

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/magiconair/properties/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/mattn/go-sqlite3/go.mod

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions vendor/github.com/miekg/pkcs11/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/mitchellh/mapstructure/go.mod

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/nxadm/tail/go.mod

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/github.com/nxadm/tail/go.sum

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/onsi/ginkgo/go.mod

This file was deleted.

67 changes: 0 additions & 67 deletions vendor/github.com/onsi/ginkgo/go.sum

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/onsi/gomega/go.mod

This file was deleted.

0 comments on commit c025d5e

Please sign in to comment.