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

chore: update go to 1.23 #6448

Merged
merged 6 commits into from
Feb 24, 2025
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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ commands:
executors:
golang:
docker:
- image: cimg/go:1.22.8
- image: cimg/go:1.23.6

jobs:
test_all:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/baisc_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: true

- name: install deps
Expand All @@ -35,7 +35,7 @@ jobs:

- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
golangci-lint run --timeout 10m

- name: Compatible all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common_build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: true

- name: install deps
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: true

- name: vars
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: true

- name: install deps
Expand Down
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ issues:
- "a blank import should be only in a main or test package, or have a comment justifying it"
- "package comment should be of the form"
- "should be of the form"
- "SA1006"

exclude-rules:
- path: pkg/constants
Expand All @@ -39,6 +40,9 @@ issues:
linters-settings:
goconst:
min-occurrences: 6
govet:
disable:
- printf

run:
skip-dirs:
Expand All @@ -48,5 +52,8 @@ run:
- venus-shared/actors/aerrors$
- venus-shared/actors/builtin$
- venus-shared/actors/policy$
- pkg/vm$
- pkg/market$
- cmd$
skip-files:
- ".*_gen\\.go$" # skip auto generated go files
4 changes: 2 additions & 2 deletions cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ var infoCmd = &cmds.Command{
}
tw := tabwriter.NewWriter(writer.w, 6, 6, 2, ' ', 0)
writer.Printf("Bandwidth:\n")
fmt.Fprintf(tw, "\tTotalIn\tTotalOut\tRateIn\tRateOut\n")
fmt.Fprintf(tw, "\t%s\t%s\t%s/s\t%s/s\n", humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
_, _ = fmt.Fprintf(tw, "\tTotalIn\tTotalOut\tRateIn\tRateOut\n")
_, _ = fmt.Fprintf(tw, "\t%s\t%s\t%s/s\t%s/s\n", humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
if err := tw.Flush(); err != nil {
return err
}
Expand Down
16 changes: 8 additions & 8 deletions cmd/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ var voucherListCmd = &cmds.Command{
if err != nil {
return err
}
fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
_, _ = fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
}

return re.Emit(buff)
Expand Down Expand Up @@ -362,7 +362,7 @@ var voucherBestSpendableCmd = &cmds.Command{
if err != nil {
return err
}
fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
_, _ = fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
}
return re.Emit(buff)
},
Expand Down Expand Up @@ -422,15 +422,15 @@ func paychStatus(writer io.Writer, avail *types.ChannelAvailableFunds) {
if avail.Channel == nil {
if avail.PendingWaitSentinel != nil {
fmt.Fprint(writer, "Creating channel\n")
fmt.Fprintf(writer, " From: %s\n", avail.From)
fmt.Fprintf(writer, " To: %s\n", avail.To)
fmt.Fprintf(writer, " Pending Amt: %s\n", types.FIL(avail.PendingAmt))
fmt.Fprintf(writer, " Wait Sentinel: %s\n", avail.PendingWaitSentinel)
_, _ = fmt.Fprintf(writer, " From: %s\n", avail.From)
_, _ = fmt.Fprintf(writer, " To: %s\n", avail.To)
_, _ = fmt.Fprintf(writer, " Pending Amt: %s\n", types.FIL(avail.PendingAmt))
_, _ = fmt.Fprintf(writer, " Wait Sentinel: %s\n", avail.PendingWaitSentinel)
return
}
fmt.Fprint(writer, "Channel does not exist\n")
fmt.Fprintf(writer, " From: %s\n", avail.From)
fmt.Fprintf(writer, " To: %s\n", avail.To)
_, _ = fmt.Fprintf(writer, " From: %s\n", avail.From)
_, _ = fmt.Fprintf(writer, " To: %s\n", avail.To)
return
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ var statsBandwidthCmd = &cmds.Command{

tw := tabwriter.NewWriter(buf, 4, 4, 2, ' ', 0)

fmt.Fprintf(tw, "Segment\tTotalIn\tTotalOut\tRateIn\tRateOut\n")
_, _ = fmt.Fprintf(tw, "Segment\tTotalIn\tTotalOut\tRateIn\tRateOut\n")

if bypeer {
bw, err := netAPI.NetBandwidthStatsByPeer(ctx)
Expand All @@ -401,7 +401,7 @@ var statsBandwidthCmd = &cmds.Command{

for _, p := range peers {
s := bw[p]
fmt.Fprintf(tw, "%s\t%s\t%s\t%s/s\t%s/s\n", p, humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
_, _ = fmt.Fprintf(tw, "%s\t%s\t%s\t%s/s\t%s/s\n", p, humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
}
} else if byproto {
bw, err := netAPI.NetBandwidthStatsByProtocol(ctx)
Expand All @@ -423,7 +423,7 @@ var statsBandwidthCmd = &cmds.Command{
if p == "" {
p = "<unknown>"
}
fmt.Fprintf(tw, "%s\t%s\t%s\t%s/s\t%s/s\n", p, humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
_, _ = fmt.Fprintf(tw, "%s\t%s\t%s\t%s/s\t%s/s\n", p, humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
}
} else {

Expand All @@ -432,7 +432,7 @@ var statsBandwidthCmd = &cmds.Command{
return err
}

fmt.Fprintf(tw, "Total\t%s\t%s\t%s/s\t%s/s\n", humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
_, _ = fmt.Fprintf(tw, "Total\t%s\t%s\t%s/s\t%s/s\n", humanize.Bytes(uint64(s.TotalIn)), humanize.Bytes(uint64(s.TotalOut)), humanize.Bytes(uint64(s.RateIn)), humanize.Bytes(uint64(s.RateOut)))
}

if err := tw.Flush(); err != nil {
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/filecoin-project/venus

go 1.22.7
go 1.23

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
Expand Down
22 changes: 11 additions & 11 deletions venus-devtool/api-gen/doc_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,32 +186,32 @@ curl http://<ip>:<port>/rpc/v{{ .APIVersion }} -X POST -H "Content-Type: applica
return g.Methods[i].Name < g.Methods[j].Name
})

fmt.Fprintf(buf, "* [%s](#%s)\n", g.GroupName, strings.ToLower(g.GroupName))
_, _ = fmt.Fprintf(buf, "* [%s](#%s)\n", g.GroupName, strings.ToLower(g.GroupName))
for _, method := range g.Methods {
fmt.Fprintf(buf, " * [%s](#%s)\n", method.Name, strings.ToLower(method.Name))
_, _ = fmt.Fprintf(buf, " * [%s](#%s)\n", method.Name, strings.ToLower(method.Name))
}
}

fmt.Fprintf(buf, "\n")
_, _ = fmt.Fprintf(buf, "\n")
for _, g := range groups {
fmt.Fprintf(buf, "## %s\n\n", g.GroupName)
_, _ = fmt.Fprintf(buf, "## %s\n\n", g.GroupName)

for _, m := range g.Methods {
fmt.Fprintf(buf, "### %s\n", m.Name)
fmt.Fprintf(buf, "%s\n\n", m.Comment)
_, _ = fmt.Fprintf(buf, "### %s\n", m.Name)
_, _ = fmt.Fprintf(buf, "%s\n\n", m.Comment)

fmt.Fprintf(buf, "Perms: %s\n\n", m.Perm)
_, _ = fmt.Fprintf(buf, "Perms: %s\n\n", m.Perm)

if strings.Count(m.InputExample, "\n") > 0 {
fmt.Fprintf(buf, "Inputs:\n```json\n%s\n```\n\n", m.InputExample)
_, _ = fmt.Fprintf(buf, "Inputs:\n```json\n%s\n```\n\n", m.InputExample)
} else {
fmt.Fprintf(buf, "Inputs: `%s`\n\n", m.InputExample)
_, _ = fmt.Fprintf(buf, "Inputs: `%s`\n\n", m.InputExample)
}

if strings.Count(m.ResponseExample, "\n") > 0 {
fmt.Fprintf(buf, "Response:\n```json\n%s\n```\n\n", m.ResponseExample)
_, _ = fmt.Fprintf(buf, "Response:\n```json\n%s\n```\n\n", m.ResponseExample)
} else {
fmt.Fprintf(buf, "Response: `%s`\n\n", m.ResponseExample)
_, _ = fmt.Fprintf(buf, "Response: `%s`\n\n", m.ResponseExample)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/api-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
app.Setup()

if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
_, _ = fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
}
}

Expand Down
26 changes: 13 additions & 13 deletions venus-devtool/api-gen/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func GenProxyForAPI(t util.APIMeta) error {

var fileBuffer bytes.Buffer

fmt.Fprintf(&fileBuffer, "// Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT.\npackage %s\n\n", api.Pkg.Name)
_, _ = fmt.Fprintf(&fileBuffer, "// Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT.\npackage %s\n\n", api.Pkg.Name)

err = writeImports(deps, &fileBuffer)
if err != nil {
Expand Down Expand Up @@ -83,7 +83,7 @@ func writeImports(deps map[string]util.ImportMeta, dst *bytes.Buffer) error {

}

fmt.Fprintln(dst, "import (")
_, _ = fmt.Fprintln(dst, "import (")
for _, impGroup := range imports {
for _, imp := range impGroup {
_, err := fmt.Fprintf(dst, "\t%s \"%s\"\n", imp[0], imp[1])
Expand All @@ -92,10 +92,10 @@ func writeImports(deps map[string]util.ImportMeta, dst *bytes.Buffer) error {
}
}

fmt.Fprintln(dst, "")
_, _ = fmt.Fprintln(dst, "")
}

fmt.Fprintln(dst, ")")
_, _ = fmt.Fprintln(dst, ")")
return nil
}

Expand Down Expand Up @@ -147,18 +147,18 @@ type %s struct {
)

func writeStruct(dst *bytes.Buffer, ifaceMeta *util.InterfaceMeta, astMeta *util.ASTMeta) error {
fmt.Fprintf(dst, structHeadFormat, common.StructName(ifaceMeta.Name))
_, _ = fmt.Fprintf(dst, structHeadFormat, common.StructName(ifaceMeta.Name))

for _, nested := range ifaceMeta.Nested {
fmt.Fprintf(dst, "\t%s\n", common.StructName(nested))
_, _ = fmt.Fprintf(dst, "\t%s\n", common.StructName(nested))
}

tmpBuf := &bytes.Buffer{}
if len(ifaceMeta.Defined) > 0 {
fmt.Fprint(dst, structInternalHead)
_, _ = fmt.Fprint(dst, structInternalHead)

for _, meth := range ifaceMeta.Defined {
fmt.Fprintf(dst, "\t\t%s ", meth.Name)
_, _ = fmt.Fprintf(dst, "\t\t%s ", meth.Name)

err := printer.Fprint(tmpBuf, astMeta.FileSet, meth.FuncType)
if err != nil {
Expand All @@ -168,13 +168,13 @@ func writeStruct(dst *bytes.Buffer, ifaceMeta *util.InterfaceMeta, astMeta *util
dst.WriteString(strings.ReplaceAll(tmpBuf.String(), "\n\t", ""))
tmpBuf.Reset()

fmt.Fprint(dst, util.GetMethodComment(meth))
_, _ = fmt.Fprint(dst, util.GetMethodComment(meth))
}

fmt.Fprint(dst, structInternalTail)
_, _ = fmt.Fprint(dst, structInternalTail)
}

fmt.Fprint(dst, structTail)
_, _ = fmt.Fprint(dst, structTail)
return nil
}

Expand All @@ -186,7 +186,7 @@ func writeMethods(dst *bytes.Buffer, ifaceMeta *util.InterfaceMeta, astMeta *uti
return fmt.Errorf("write method for %s.%s: %w", ifaceMeta.Name, meth.Name, err)
}
}
fmt.Fprintln(dst, "")
_, _ = fmt.Fprintln(dst, "")
return nil
}

Expand Down Expand Up @@ -325,6 +325,6 @@ func writeMethodBody(dst *bytes.Buffer, typBuf *bytes.Buffer, ifaceMeta *util.In
}

sname := common.StructName(ifaceMeta.Name)
fmt.Fprintf(dst, "func(s *%s) %s(%s) (%s) { return s.Internal.%s(%s) }\n", sname, methMeta.Name, strings.Join(params, ", "), strings.Join(results, ", "), methMeta.Name, strings.Join(callNames, ", "))
_, _ = fmt.Fprintf(dst, "func(s *%s) %s(%s) (%s) { return s.Internal.%s(%s) }\n", sname, methMeta.Name, strings.Join(params, ", "), strings.Join(results, ", "), methMeta.Name, strings.Join(callNames, ", "))
return nil
}
2 changes: 1 addition & 1 deletion venus-devtool/bundle-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
app.Setup()

if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
_, _ = fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
}
}

Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/compatible/actors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
app.Setup()

if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
_, _ = fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
}
}

Expand Down
4 changes: 2 additions & 2 deletions venus-devtool/compatible/apis/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ var checksumCmd = &cli.Command{

for ii := 0; ii < numIn; ii++ {
inTyp := meth.Type.In(ii)
fmt.Fprintf(&buf, "\tIn: %s\n", formatType(inTyp)) // nolint
_, _ = fmt.Fprintf(&buf, "\tIn: %s\n", formatType(inTyp)) // nolint
}

for oi := 0; oi < numOut; oi++ {
outTyp := meth.Type.Out(oi)
fmt.Fprintf(&buf, "\tOut: %s\n", formatType(outTyp)) // nolint
_, _ = fmt.Fprintf(&buf, "\tOut: %s\n", formatType(outTyp)) // nolint
}

fmt.Printf("\t%s:\tIn=%d,\tOut=%d,\tCheckSum=%x\n", meth.Name, numIn, numOut, md5.Sum(buf.Bytes()))
Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/compatible/apis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ func main() {
app.Setup()

if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
_, _ = fmt.Fprintf(os.Stderr, "ERR: %v\n", err) // nolint: errcheck
}
}
4 changes: 1 addition & 3 deletions venus-devtool/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/filecoin-project/venus/venus-devtool

go 1.22.7

toolchain go1.23.2
go 1.23

require (
github.com/filecoin-project/go-address v1.2.0
Expand Down
Loading
Loading