Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove golang toolchain as nit fix #1250

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/test-network-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Set up the Test Network Runtime
inputs:
go-version:
description: Version of go
default: '1.22'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Go version was intentionally moved to 1.22 since 1.21 is no longer supported since Go 1.23 was released. See the Go release policy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, how about we upgrade go mod files into golang 1.22?

default: '1.21'
node-version:
description: Version of node
default: 18.x
Expand Down
2 changes: 1 addition & 1 deletion asset-transfer-basic/chaincode-external/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

ARG GO_VER=1.22
ARG GO_VER=1.21
ARG ALPINE_VER=3.20

FROM golang:${GO_VER}-alpine${ALPINE_VER}
Expand Down
2 changes: 0 additions & 2 deletions asset-transfer-basic/chaincode-go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go

go 1.21

toolchain go1.22.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I caused this when I bulk updated dependencies to the v2 chaincode APIs. By default the go mod command sets the toolchain to the specific Go version is used to run the command, which might impose more restrictive version constraints than the go directive.

In other repositories we have been taking the approach of avoiding a toolchain directive but specifying a full (3-digit) version for the go directive. For current Go versions, the go version is used as the toolchain if no toolchain is specified, and toolchain must be a full (3-digit) Go version. That might be the right thing to do here too.


require (
github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0-20240618210511-f7903324a8af
github.com/hyperledger/fabric-contract-api-go/v2 v2.0.0
Expand Down
Loading