Skip to content

Commit

Permalink
Merge pull request #714 from smallstep/max/go-1.19
Browse files Browse the repository at this point in the history
Change actions to build using go 1.19
  • Loading branch information
dopey committed Aug 9, 2022
2 parents e6ffcfb + 0c51280 commit 5721407
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 75 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.17', '1.18' ]
go: [ '1.18', '1.19' ]
steps:
-
name: Checkout
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
-
name: Configure Go
id: configure_go
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
-
name: Install cosign
uses: sigstore/cosign-installer@v1.1.0
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
-
name: Build
id: build
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
-
name: Build
id: build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.17', '1.18' ]
go: [ '1.18', '1.19' ]
steps:
-
name: Checkout
Expand All @@ -28,7 +28,7 @@ jobs:
name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: 'v1.45.2'
version: 'v1.48'
args: --timeout=30m
-
name: Test, Build
Expand All @@ -37,7 +37,7 @@ jobs:
-
name: Codecov
uses: codecov/codecov-action@v1.2.1
if: matrix.go == '1.18'
if: matrix.go == '1.19'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out # optional
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add the certificate signature to `step ssh inspect` output.
- Add the `--mtls=false` flag to force the token authorization flow on `step ca
renew`.
### Changed
- Support two latest versions of Go (1.18, 1.19)

## [0.21.0] - 2022-07-06
### Added
Expand Down
11 changes: 6 additions & 5 deletions command/certificate/remote.go
Expand Up @@ -26,11 +26,12 @@ var urlPrefixes = map[string]uint16{
// If the address does not contain a port then default to port 443.
//
// Params
// *addr*: can be a host (e.g. smallstep.com) or an IP (e.g. 127.0.0.1)
// *serverName*: use a specific Server Name Indication (e.g. smallstep.com)
// *roots*: a file, a directory, or a comma-separated list of files.
// *insecure*: do not verify that the server's certificate has been signed by
// a trusted root
//
// *addr*: can be a host (e.g. smallstep.com) or an IP (e.g. 127.0.0.1)
// *serverName*: use a specific Server Name Indication (e.g. smallstep.com)
// *roots*: a file, a directory, or a comma-separated list of files.
// *insecure*: do not verify that the server's certificate has been signed by
// a trusted root
func getPeerCertificates(addr, serverName, roots string, insecure bool) ([]*x509.Certificate, error) {
var (
err error
Expand Down
6 changes: 3 additions & 3 deletions command/crypto/change-pass.go
Expand Up @@ -87,9 +87,9 @@ $ step crypto change-pass key.jwk --out new-key.jwk
}

// changePassAction does the following:
// 1. decrypts a private key (if necessary)
// 2. encrypts the key using a new password
// 3. writes the encrypted key to the original file
// 1. decrypts a private key (if necessary)
// 2. encrypts the key using a new password
// 3. writes the encrypted key to the original file
func changePassAction(ctx *cli.Context) error {
if err := errs.NumberOfArguments(ctx, 1); err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions command/crypto/hash/hash.go
Expand Up @@ -312,11 +312,11 @@ func hashFile(h hash.Hash, filename string) ([]byte, error) {

// hashDir creates a hash of a directory adding the following data to the
// hash:
// 1. Add directory mode bits to the hash
// 2. For each file/directory in directory:
// 1. Add directory mode bits to the hash
// 2. For each file/directory in directory:
// 2.1 If file: add file mode bits and sum
// 2.2 If directory: do hashDir and add sum
// 3. return sum
// 3. return sum
func hashDir(hc hashConstructor, dirname string) ([]byte, error) {
// ReadDir returns the entries sorted by filename
dirEntries, err := os.ReadDir(dirname)
Expand Down
9 changes: 5 additions & 4 deletions crypto/sshutil/shell.go
Expand Up @@ -17,10 +17,11 @@ import (
)

// ProxyCommand replaces %%, %h, %p, and %r in the given command.
// %% A literal `%`.
// %h The remote hostname.
// %p The remote port.
// %r The remote username.
//
// %% A literal `%`.
// %h The remote hostname.
// %p The remote port.
// %r The remote username.
func ProxyCommand(cmd, user, host, port string) string {
cmd = strings.ReplaceAll(cmd, "%%", "%")
cmd = strings.ReplaceAll(cmd, "%h", host)
Expand Down
12 changes: 6 additions & 6 deletions flags/flags.go
Expand Up @@ -465,9 +465,9 @@ func ParseTemplateData(ctx *cli.Context) (json.RawMessage, error) {
}

// ParseCaURL gets and parses the ca-url from the command context.
// - Require non-empty value.
// - Prepend an 'https' scheme if the URL does not have a scheme.
// - Error if the URL scheme is not implicitly or explicitly 'https'.
// - Require non-empty value.
// - Prepend an 'https' scheme if the URL does not have a scheme.
// - Error if the URL scheme is not implicitly or explicitly 'https'.
func ParseCaURL(ctx *cli.Context) (string, error) {
caURL := ctx.String("ca-url")
if caURL == "" && !ctx.Bool("offline") {
Expand All @@ -479,9 +479,9 @@ func ParseCaURL(ctx *cli.Context) (string, error) {

// ParseCaURLIfExists gets and parses the ca-url from the command context, if
// one is present.
// - Allow empty value.
// - Prepend an 'https' scheme if the URL does not have a scheme.
// - Error if the URL scheme is not implicitly or explicitly 'https'.
// - Allow empty value.
// - Prepend an 'https' scheme if the URL does not have a scheme.
// - Error if the URL scheme is not implicitly or explicitly 'https'.
func ParseCaURLIfExists(ctx *cli.Context) (string, error) {
caURL := ctx.String("ca-url")
if caURL == "" {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/smallstep/cli

go 1.17
go 1.18

require (
github.com/Microsoft/go-winio v0.4.14
Expand Down
9 changes: 0 additions & 9 deletions go.sum
Expand Up @@ -125,14 +125,12 @@ github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy86
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA=
github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8=
Expand Down Expand Up @@ -261,7 +259,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
Expand All @@ -270,7 +267,6 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/corpix/uarand v0.1.1 h1:RMr1TWc9F4n5jiPDzFHtmaUXLKLNUFK0SgCLo4BhX/U=
github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
Expand Down Expand Up @@ -499,7 +495,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
Expand Down Expand Up @@ -606,7 +601,6 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
Expand All @@ -627,7 +621,6 @@ github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5W
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
Expand Down Expand Up @@ -913,7 +906,6 @@ github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down Expand Up @@ -1063,7 +1055,6 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw=
go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw=
Expand Down
4 changes: 3 additions & 1 deletion pkg/blackfriday/inline.go
Expand Up @@ -721,7 +721,9 @@ func linkEndsWithEntity(data []byte, linkEnd int) bool {
}

// hasPrefixCaseInsensitive is a custom implementation of
// strings.HasPrefix(strings.ToLower(s), prefix)
//
// strings.HasPrefix(strings.ToLower(s), prefix)
//
// we rolled our own because ToLower pulls in a huge machinery of lowercasing
// anything from Unicode and that's very slow. Since this func will only be
// used on ASCII protocol prefixes, we can take shortcuts.
Expand Down
44 changes: 24 additions & 20 deletions pkg/blackfriday/markdown.go
Expand Up @@ -345,8 +345,8 @@ func WithNoExtensions() Option {
// In Markdown, the link reference syntax can be made to resolve a link to
// a reference instead of an inline URL, in one of the following ways:
//
// * [link text][refid]
// * [refid][]
// - [link text][refid]
// - [refid][]
//
// Usually, the refid is defined at the bottom of the Markdown document. If
// this override function is provided, the refid is passed to the override
Expand All @@ -363,21 +363,25 @@ func WithRefOverride(o ReferenceOverrideFunc) Option {
// block of markdown-encoded text.
//
// The simplest invocation of Run takes one argument, input:
// output := Run(input)
//
// output := Run(input)
//
// This will parse the input with CommonExtensions enabled and render it with
// the default HTMLRenderer (with CommonHTMLFlags).
//
// Variadic arguments opts can customize the default behavior. Since Markdown
// type does not contain exported fields, you can not use it directly. Instead,
// use the With* functions. For example, this will call the most basic
// functionality, with no extensions:
// output := Run(input, WithNoExtensions())
//
// output := Run(input, WithNoExtensions())
//
// You can use any number of With* arguments, even contradicting ones. They
// will be applied in order of appearance and the latter will override the
// former:
// output := Run(input, WithNoExtensions(), WithExtensions(exts),
// WithRenderer(yourRenderer))
//
// output := Run(input, WithNoExtensions(), WithExtensions(exts),
// WithRenderer(yourRenderer))
func Run(input []byte, opts ...Option) []byte {
r := NewHTMLRenderer(HTMLRendererParameters{
Flags: CommonHTMLFlags,
Expand Down Expand Up @@ -491,35 +495,35 @@ func (p *Markdown) parseRefsToAST() {
//
// Consider this markdown with reference-style links:
//
// [link][ref]
// [link][ref]
//
// [ref]: /url/ "tooltip title"
// [ref]: /url/ "tooltip title"
//
// It will be ultimately converted to this HTML:
//
// <p><a href=\"/url/\" title=\"title\">link</a></p>
// <p><a href=\"/url/\" title=\"title\">link</a></p>
//
// And a reference structure will be populated as follows:
//
// p.refs["ref"] = &reference{
// link: "/url/",
// title: "tooltip title",
// }
// p.refs["ref"] = &reference{
// link: "/url/",
// title: "tooltip title",
// }
//
// Alternatively, reference can contain information about a footnote. Consider
// this markdown:
//
// Text needing a footnote.[^a]
// Text needing a footnote.[^a]
//
// [^a]: This is the note
// [^a]: This is the note
//
// A reference structure will be populated as follows:
//
// p.refs["a"] = &reference{
// link: "a",
// title: "This is the note",
// noteID: <some positive int>,
// }
// p.refs["a"] = &reference{
// link: "a",
// title: "This is the note",
// noteID: <some positive int>,
// }
//
// TODO: As you can see, it begs for splitting into two dedicated structures
// for refs and for footnotes.
Expand Down
19 changes: 10 additions & 9 deletions usage/help.go
Expand Up @@ -12,11 +12,12 @@ var HelpCommandAction = cli.ActionFunc(helpAction)

// HelpCommand overwrites default urfvafe/cli help command to support one or
// multiple subcommands like:
// step help
// step help crypto
// step help crypto jwt
// step help crypto jwt sign
// ...
//
// step help
// step help crypto
// step help crypto jwt
// step help crypto jwt sign
// ...
func HelpCommand() cli.Command {
return cli.Command{
Name: "help",
Expand Down Expand Up @@ -132,13 +133,13 @@ func createParentCommand(ctx *cli.Context) cli.Command {

// createCliApp is re-implementation of urfave/cli method (in command.go):
//
// func (c Command) startApp(ctx *Context) error
// func (c Command) startApp(ctx *Context) error
//
// It lets us show the subcommands when help is executed like:
//
// step help foo
// step help foo bar
// ...
// step help foo
// step help foo bar
// ...
func createCliApp(ctx *cli.Context, cmd cli.Command) *cli.App {
app := cli.NewApp()
app.Metadata = ctx.App.Metadata
Expand Down
6 changes: 4 additions & 2 deletions usage/printer.go
Expand Up @@ -149,9 +149,11 @@ func findSectionEnd(h, s string) int {
}

// Convert some stuff that we can't easily write in help files because
// backticks and raw strings don't mix:
//
// backticks and raw strings don't mix:
//
// - "<foo>" to "`foo`"
// - "'''" to "```"
// - "'" to "```"
func markdownify(r *bytes.Buffer) string {
const escapeByte = byte('\\')
var last byte
Expand Down

0 comments on commit 5721407

Please sign in to comment.