Skip to content

Commit bb36108

Browse files
authored
Merge pull request #11 from thaJeztah/native_errors
remove github.com/pkg/errors dependency
2 parents 363267b + 7cf6fd0 commit bb36108

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

clidocstool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
package clidocstool
1616

1717
import (
18+
"errors"
1819
"io"
1920
"os"
2021

21-
"github.com/pkg/errors"
2222
"github.com/spf13/cobra"
2323
)
2424

clidocstool_md.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"strings"
2525
"text/template"
2626

27-
"github.com/pkg/errors"
2827
"github.com/spf13/cobra"
2928
"github.com/spf13/pflag"
3029
)
@@ -85,10 +84,10 @@ func (c *Client) GenMarkdownTree(cmd *cobra.Command) error {
8584
end := strings.Index(cs, "<!---MARKER_GEN_END-->")
8685

8786
if start == -1 {
88-
return errors.Errorf("no start marker in %s", mdFile)
87+
return fmt.Errorf("no start marker in %s", mdFile)
8988
}
9089
if end == -1 {
91-
return errors.Errorf("no end marker in %s", mdFile)
90+
return fmt.Errorf("no end marker in %s", mdFile)
9291
}
9392

9493
out, err := mdCmdOutput(cmd, cs)
@@ -102,7 +101,7 @@ func (c *Client) GenMarkdownTree(cmd *cobra.Command) error {
102101
return err
103102
}
104103
if err = ioutil.WriteFile(targetPath, []byte(cont), fi.Mode()); err != nil {
105-
return errors.Wrapf(err, "failed to write %s", targetPath)
104+
return fmt.Errorf("failed to write %s: %w", targetPath, err)
106105
}
107106

108107
return nil

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module github.com/docker/cli-docs-tool
33
go 1.16
44

55
require (
6-
github.com/pkg/errors v0.9.1
76
github.com/spf13/cobra v1.2.1
87
github.com/spf13/pflag v1.0.5
98
github.com/stretchr/testify v1.7.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
191191
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
192192
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
193193
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
194-
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
195-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
196194
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
197195
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
198196
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

0 commit comments

Comments
 (0)