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

bump up to go 1.23 #416

Merged
merged 4 commits into from
Sep 20, 2024
Merged
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/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
version: v1.61.0
skip-pkg-cache: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu as tape-base

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build-test

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

FROM golang:1.21 as golang
FROM golang:1.23 as golang

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build-test

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /root

#ENV GOPROXY=https://goproxy.cn,direct
ENV export GOSUMDB=off

Check warning on line 8 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build-test

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

COPY . .

Expand Down
2 changes: 1 addition & 1 deletion cmd/tape/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/alecthomas/kingpin.v2"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hyperledger-twgc/tape

go 1.21
go 1.23

require (
github.com/gogo/protobuf v1.3.2
Expand Down
2 changes: 1 addition & 1 deletion internal/fabric/core/comm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"

"github.com/opentracing/opentracing-go"
opentracing "github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down
2 changes: 1 addition & 1 deletion pkg/infra/basic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/hyperledger/fabric-protos-go-apiv2/msp"
"github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v2"
)

type TracingProposal struct {
Expand Down
11 changes: 5 additions & 6 deletions pkg/infra/basic/logger.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package basic

import (
"fmt"
"io"
"sync"
"time"

"github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"github.com/uber/jaeger-client-go"
jaeger "github.com/uber/jaeger-client-go"
"github.com/uber/jaeger-client-go/config"
)

Expand Down Expand Up @@ -75,7 +74,7 @@ type TracingSpans struct {
}

func (TS *TracingSpans) MakeSpan(txid, address, event string, parent opentracing.Span) opentracing.Span {
str := fmt.Sprintf(event + address)
str := event + address
if parent == nil {
return opentracing.GlobalTracer().StartSpan(str, opentracing.Tag{Key: "txid", Value: txid})
} else {
Expand All @@ -87,7 +86,7 @@ func (TS *TracingSpans) GetSpan(txid, address, event string) opentracing.Span {
TS.Lock.Lock()
defer TS.Lock.Unlock()

str := fmt.Sprintf(event + txid + address)
str := event + txid + address
span, ok := TS.Spans[str]
if ok {
return span
Expand All @@ -99,7 +98,7 @@ func (TS *TracingSpans) SpanIntoMap(txid, address, event string, parent opentrac
TS.Lock.Lock()
defer TS.Lock.Unlock()

str := fmt.Sprintf(event + txid + address)
str := event + txid + address
span, ok := TS.Spans[str]
if !ok {
span = TS.MakeSpan(txid, address, event, parent)
Expand All @@ -112,7 +111,7 @@ func (TS *TracingSpans) FinishWithMap(txid, address, event string) {
TS.Lock.Lock()
defer TS.Lock.Unlock()

str := fmt.Sprintf(event + txid + address)
str := event + txid + address
span, ok := TS.Spans[str]
if ok {
span.Finish()
Expand Down
4 changes: 2 additions & 2 deletions pkg/infra/trafficGenerator/fuzzing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ func FuzzConvertString(f *testing.F) {
f.Fuzz(func(t *testing.T, orig string) {
data, err := trafficGenerator.ConvertString(orig)
if utf8.ValidString(orig) && err != nil && !utf8.ValidString(data) && len(data) != 0 {
t.Errorf(err.Error() + " " + orig + " " + data)
t.Error(err.Error() + " " + orig + " " + data)
}
if !utf8.ValidString(data) {
t.Errorf("fail to convert utf8 string" + data)
t.Error("fail to convert utf8 string" + data)
}
})
}
Loading