Skip to content

Commit

Permalink
bump up to go 1.23 (#416)
Browse files Browse the repository at this point in the history
* bump up to go 1.23

Signed-off-by: Sam Yuan <yy19902439@126.com>

* fix up

Signed-off-by: Sam Yuan <yy19902439@126.com>

* fix lint

Signed-off-by: Sam Yuan <yy19902439@126.com>

* fix up

Signed-off-by: Sam Yuan <yy19902439@126.com>

---------

Signed-off-by: Sam Yuan <yy19902439@126.com>
  • Loading branch information
SamYuan1990 authored Sep 20, 2024
1 parent aa97190 commit 98d4ab1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
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,6 +1,6 @@
FROM ubuntu as tape-base

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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 / build-and-push-image

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/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push-image

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

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)
}
})
}

0 comments on commit 98d4ab1

Please sign in to comment.