Skip to content

Commit

Permalink
chore: update dependencies (#66)
Browse files Browse the repository at this point in the history
- Update dependencies
- Replace `github.com/pkg/errors` with stdlib `errors` package
* update workflow go-build.yml to use go1.23
* set go-versions for go-test
  • Loading branch information
gammazero authored Oct 21, 2024
1 parent bfd8a01 commit e44da6f
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 1,094 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest
name: All
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: "1.18.x"
go-version: "1.23.x"
- name: Build iptb
run: make iptb
- name: Build ipfslocal
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ concurrency:
jobs:
go-test:
uses: ipdxco/unified-github-workflows/.github/workflows/[email protected]
with:
go-versions: '["this"]'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
25 changes: 12 additions & 13 deletions browser/browseripfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pluginbrowseripfs

import (
"context"
"errors"
"fmt"
"io"
"os"
Expand All @@ -12,14 +13,12 @@ import (
"syscall"
"time"

"github.com/ipfs/kubo/config"
serial "github.com/ipfs/kubo/config/serialize"
peer "github.com/libp2p/go-libp2p/core/peer"
"github.com/pkg/errors"

iptbplugins "github.com/ipfs/iptb-plugins"
testbedi "github.com/ipfs/iptb/testbed/interfaces"
iptbutil "github.com/ipfs/iptb/util"
"github.com/ipfs/kubo/config"
serial "github.com/ipfs/kubo/config/serialize"
peer "github.com/libp2p/go-libp2p/core/peer"
)

var errTimeout = errors.New("timeout")
Expand Down Expand Up @@ -63,7 +62,7 @@ func NewNode(dir string, attrs map[string]string) (testbedi.Core, error) {
} else {
jsipfspath, err := exec.LookPath("jsipfs")
if err != nil {
return nil, fmt.Errorf("no `repobuilder` provided, could not find jsipfs in path")
return nil, errors.New("no `repobuilder` provided, could not find jsipfs in path")
}

repobuilder = jsipfspath
Expand All @@ -75,7 +74,7 @@ func NewNode(dir string, attrs map[string]string) (testbedi.Core, error) {
if v, ok := attrs["source"]; ok {
source = v
} else {
return nil, fmt.Errorf("no `source` provided")
return nil, errors.New("no `source` provided")
}

return &BrowserIpfs{
Expand Down Expand Up @@ -104,7 +103,7 @@ func (l *BrowserIpfs) Init(ctx context.Context, agrs ...string) (testbedi.Output

lcfg, ok := icfg.(*config.Config)
if !ok {
return nil, fmt.Errorf("error: Config() is not an ipfs config")
return nil, errors.New("error: Config() is not an ipfs config")
}

// jsipfs does not like this value being nil, so it needs to be set to an empty array
Expand Down Expand Up @@ -246,7 +245,7 @@ func (l *BrowserIpfs) RunCmd(ctx context.Context, stdin io.Reader, args ...strin
switch oerr := exiterr.(type) {
case *exec.ExitError:
if ctx.Err() == context.DeadlineExceeded {
err = errors.Wrapf(oerr, "context deadline exceeded for command: %q", strings.Join(cmd.Args, " "))
err = fmt.Errorf("%w for command: %q", oerr, strings.Join(cmd.Args, " "))
}

exitcode = 1
Expand Down Expand Up @@ -274,18 +273,18 @@ func (l *BrowserIpfs) Connect(ctx context.Context, tbn testbedi.Core) error {
}
}

return fmt.Errorf("could not connect using any address")
return errors.New("could not connect using any address")
}

func (l *BrowserIpfs) Shell(ctx context.Context, nodes []testbedi.Core) error {
shell := os.Getenv("SHELL")
if shell == "" {
return fmt.Errorf("no shell found")
return errors.New("no shell found")
}

if len(os.Getenv("IPFS_PATH")) != 0 {
// If the users shell sets IPFS_PATH, it will just be overridden by the shell again
return fmt.Errorf("shell has IPFS_PATH set, please unset before trying to use iptb shell")
return errors.New("shell has IPFS_PATH set, please unset before trying to use iptb shell")
}

nenvs, err := l.env()
Expand Down Expand Up @@ -358,7 +357,7 @@ func (l *BrowserIpfs) Type() string {

func (l *BrowserIpfs) signalAndWait(p *os.Process, waitch <-chan struct{}, signal os.Signal, t time.Duration) error {
if err := p.Signal(signal); err != nil {
return errors.Wrapf(err, "error killing daemon %s", l.dir)
return fmt.Errorf("error killing daemon %s: %w", l.dir, err)
}

select {
Expand Down
22 changes: 11 additions & 11 deletions docker/dockeripfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package plugindockeripfs
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"os"
Expand All @@ -16,7 +17,6 @@ import (
serial "github.com/ipfs/kubo/config/serialize"
peer "github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr"
"github.com/pkg/errors"
cnet "github.com/whyrusleeping/go-ctrlnet"

iptbplugins "github.com/ipfs/iptb-plugins"
Expand Down Expand Up @@ -69,7 +69,7 @@ func NewNode(dir string, attrs map[string]string) (testbedi.Core, error) {
} else {
ipfspath, err := exec.LookPath("ipfs")
if err != nil {
return nil, fmt.Errorf("no `repobuilder` provided, could not find ipfs in path")
return nil, errors.New("no `repobuilder` provided, could not find ipfs in path")
}

repobuilder = ipfspath
Expand Down Expand Up @@ -152,7 +152,7 @@ func (l *DockerIpfs) Init(ctx context.Context, args ...string) (testbedi.Output,

lcfg, ok := icfg.(*config.Config)
if !ok {
return nil, fmt.Errorf("error: Config() is not an ipfs config")
return nil, errors.New("error: Config() is not an ipfs config")
}

lcfg.Bootstrap = nil
Expand All @@ -176,7 +176,7 @@ func (l *DockerIpfs) Start(ctx context.Context, wait bool, args ...string) (test
}

if alive {
return nil, fmt.Errorf("node is already running")
return nil, errors.New("node is already running")
}

fargs := []string{"run", "-d", "-v", l.dir + ":/data/ipfs", l.image}
Expand Down Expand Up @@ -269,7 +269,7 @@ func (l *DockerIpfs) RunCmd(ctx context.Context, stdin io.Reader, args ...string
switch oerr := exiterr.(type) {
case *exec.ExitError:
if ctx.Err() == context.DeadlineExceeded {
err = errors.Wrapf(oerr, "context deadline exceeded for command: %q", strings.Join(cmd.Args, " "))
err = fmt.Errorf("context deadline exceeded for command: %q: %w", strings.Join(cmd.Args, " "), oerr)
}

exitcode = 1
Expand Down Expand Up @@ -309,7 +309,7 @@ func (l *DockerIpfs) Connect(ctx context.Context, n testbedi.Core) error {
return err
}

return fmt.Errorf("%s", string(out))
return errors.New(string(out))
}

return nil
Expand Down Expand Up @@ -404,7 +404,7 @@ func (l *DockerIpfs) Events() (io.ReadCloser, error) {
}

func (l *DockerIpfs) Logs() (io.ReadCloser, error) {
return nil, fmt.Errorf("not implemented")
return nil, errors.New("not implemented")
}

// Attribute Interface
Expand Down Expand Up @@ -444,11 +444,11 @@ func (l *DockerIpfs) SetAttr(attr string, val string) error {
}

func (l *DockerIpfs) StderrReader() (io.ReadCloser, error) {
return nil, fmt.Errorf("not implemented")
return nil, errors.New("not implemented")
}

func (l *DockerIpfs) StdoutReader() (io.ReadCloser, error) {
return nil, fmt.Errorf("not implemented")
return nil, errors.New("not implemented")
}

func (l *DockerIpfs) Config() (interface{}, error) {
Expand Down Expand Up @@ -530,7 +530,7 @@ func (l *DockerIpfs) getInterfaceName() (string, error) {
}

if cside == "" {
return "", fmt.Errorf("container-side interface not found")
return "", errors.New("container-side interface not found")
}

localout, err := exec.Command("ip", "link").CombinedOutput()
Expand All @@ -544,7 +544,7 @@ func (l *DockerIpfs) getInterfaceName() (string, error) {
}
}

return "", fmt.Errorf("could not determine interface")
return "", errors.New("could not determine interface")
}

func (l *DockerIpfs) setLatency(val string) error {
Expand Down
123 changes: 70 additions & 53 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,80 +1,97 @@
module github.com/ipfs/iptb-plugins

require (
github.com/ipfs/iptb v1.4.0
github.com/ipfs/kubo v0.16.0
github.com/libp2p/go-libp2p v0.24.2
github.com/libp2p/go-libp2p-daemon v0.4.0
github.com/multiformats/go-multiaddr v0.8.0
github.com/pkg/errors v0.9.1
github.com/ipfs/iptb v1.4.1
github.com/ipfs/kubo v0.31.0
github.com/libp2p/go-libp2p v0.36.5
github.com/libp2p/go-libp2p-daemon v0.9.1
github.com/multiformats/go-multiaddr v0.13.0
github.com/whyrusleeping/go-ctrlnet v0.0.0-20180313164037-f564fbbdaa95
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/gxed/go-shellwords v1.0.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-block-format v0.0.3 // indirect
github.com/ipfs/go-blockservice v0.4.0 // indirect
github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/boxo v0.24.0 // indirect
github.com/ipfs/go-block-format v0.2.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ipfs-blockstore v1.2.0 // indirect
github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect
github.com/ipfs/go-ipfs-exchange-interface v0.2.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipld-cbor v0.0.5 // indirect
github.com/ipfs/go-ipld-format v0.4.0 // indirect
github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
github.com/ipfs/go-ipld-format v0.6.0 // indirect
github.com/ipfs/go-ipld-legacy v0.2.1 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipfs/go-merkledag v0.6.0 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-verifcid v0.0.2 // indirect
github.com/ipfs/interface-go-ipfs-core v0.7.0 // indirect
github.com/ipld/go-codec-dagpb v1.4.1 // indirect
github.com/ipld/go-ipld-prime v0.19.0 // indirect
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.26.1 // indirect
github.com/libp2p/go-libp2p-kbucket v0.6.4 // indirect
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/miekg/dns v1.1.61 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.7.0 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-multiaddr-dns v0.4.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.46.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/urfave/cli v1.22.10 // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/protobuf v1.28.1 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
github.com/urfave/cli v1.22.16 // indirect
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.23.0 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)

go 1.22
go 1.23
Loading

0 comments on commit e44da6f

Please sign in to comment.