Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Remove github.com/pkg/errors
Browse files Browse the repository at this point in the history
There is no need github.com/pkg/errors, we should stick with the native
errors package. To wrap errors we can use `fmt.Errorf("%w",err)`.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Sep 6, 2021
1 parent b106ee6 commit 73614d4
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 703 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ go 1.16
require (
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1
github.com/pkg/errors v0.9.1
)
8 changes: 4 additions & 4 deletions plugins/meta/podman-machine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
Expand All @@ -28,14 +29,13 @@ import (
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/version"
bv "github.com/containernetworking/plugins/pkg/utils/buildversion"
"github.com/pkg/errors"
)

func cmdAdd(args *skel.CmdArgs) error {
// Get the port information from the chained plugin
portMaps, err := parseConfig(args.StdinData, args.Args)
if err != nil {
return errors.Wrap(err, "failed to parse config")
return fmt.Errorf("failed to parse config: %w", err)
}

hostAddr, err := getPrimaryIP()
Expand Down Expand Up @@ -120,12 +120,12 @@ func cmdCheck(args *skel.CmdArgs) error {
func parseConfig(stdin []byte, args string) (*PortMapConf, error) {
conf := PortMapConf{}
if err := json.Unmarshal(stdin, &conf); err != nil {
return nil, fmt.Errorf("failed to parse network configuration: %v", err)
return nil, fmt.Errorf("failed to parse network configuration: %w", err)
}
// Parse previous result.
if conf.RawPrevResult != nil {
if err := version.ParsePrevResult(&conf.NetConf); err != nil {
return nil, errors.Wrap(err, "could not parse prevResult")
return nil, fmt.Errorf("could not parse prevResult: %w", err)
}
}
return &conf, nil
Expand Down
24 changes: 0 additions & 24 deletions vendor/github.com/pkg/errors/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/github.com/pkg/errors/.travis.yml

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/pkg/errors/LICENSE

This file was deleted.

44 changes: 0 additions & 44 deletions vendor/github.com/pkg/errors/Makefile

This file was deleted.

59 changes: 0 additions & 59 deletions vendor/github.com/pkg/errors/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions vendor/github.com/pkg/errors/appveyor.yml

This file was deleted.

Loading

0 comments on commit 73614d4

Please sign in to comment.