diff --git a/test/tools/go.mod b/test/tools/go.mod index 3908c5641a..d817d08ebe 100644 --- a/test/tools/go.mod +++ b/test/tools/go.mod @@ -6,7 +6,7 @@ module github.com/containers/podman/test/tools go 1.22.0 require ( - github.com/cpuguy83/go-md2man/v2 v2.0.5 + github.com/cpuguy83/go-md2man/v2 v2.0.6 github.com/go-swagger/go-swagger v0.30.5 github.com/onsi/ginkgo/v2 v2.22.0 github.com/vbatts/git-validation v1.2.1 diff --git a/test/tools/go.sum b/test/tools/go.sum index afbd743212..eec37e3f8e 100644 --- a/test/tools/go.sum +++ b/test/tools/go.sum @@ -57,8 +57,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= -github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/README.md b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/README.md index 0e30d34148..dedc16d0c6 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/README.md +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/README.md @@ -3,13 +3,12 @@ go-md2man Converts markdown into roff (man pages). -Uses blackfriday to process markdown into man pages. +Uses [blackfriday](https://github.com/russross/blackfriday) to process markdown into man pages. ### Usage -./md2man -in /path/to/markdownfile.md -out /manfile/output/path +```bash +go install github.com/cpuguy83/go-md2man@latest -### How to contribute - -We use go modules to manage dependencies. -As such you must be using at lest go1.11. +go-md2man -in /path/to/markdownfile.md -out /manfile/output/path +``` diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go index 4ea49f3734..4ff873b8e7 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go @@ -3,7 +3,7 @@ package main import ( "flag" "fmt" - "io" + "io/ioutil" "os" "github.com/cpuguy83/go-md2man/v2/md2man" @@ -28,7 +28,7 @@ func main() { } defer inFile.Close() // nolint: errcheck - doc, err := io.ReadAll(inFile) + doc, err := ioutil.ReadAll(inFile) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index 9d6c473fdc..96a80c99b8 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -104,7 +104,7 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering node.Parent.Prev.Type == blackfriday.Heading && node.Parent.Prev.FirstChild != nil && bytes.EqualFold(node.Parent.Prev.FirstChild.Literal, []byte("NAME")) { - before, after, found := bytes.Cut(node.Literal, []byte(" - ")) + before, after, found := bytesCut(node.Literal, []byte(" - ")) escapeSpecialChars(w, before) if found { out(w, ` \- `) @@ -406,3 +406,12 @@ func escapeSpecialCharsLine(w io.Writer, text []byte) { w.Write([]byte{'\\', text[i]}) // nolint: errcheck } } + +// bytesCut is a copy of [bytes.Cut] to provide compatibility with go1.17 +// and older. We can remove this once we drop support for go1.17 and older. +func bytesCut(s, sep []byte) (before, after []byte, found bool) { + if i := bytes.Index(s, sep); i >= 0 { + return s[:i], s[i+len(sep):], true + } + return s, nil, false +} diff --git a/test/tools/vendor/modules.txt b/test/tools/vendor/modules.txt index e67a28afcc..b697b76627 100644 --- a/test/tools/vendor/modules.txt +++ b/test/tools/vendor/modules.txt @@ -10,8 +10,8 @@ github.com/Masterminds/sprig/v3 # github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 ## explicit; go 1.13 github.com/asaskevich/govalidator -# github.com/cpuguy83/go-md2man/v2 v2.0.5 -## explicit; go 1.11 +# github.com/cpuguy83/go-md2man/v2 v2.0.6 +## explicit; go 1.12 github.com/cpuguy83/go-md2man/v2 github.com/cpuguy83/go-md2man/v2/md2man # github.com/fatih/color v1.15.0