Skip to content

Commit

Permalink
liqoctl: replace deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
giorio94 authored and adamjensenbot committed Jun 14, 2022
1 parent 683e060 commit b3c6dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require (
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e
golang.org/x/text v0.3.7
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220330030906-9490840b0b01
gomodules.xyz/jsonpatch/v2 v2.2.0
google.golang.org/api v0.74.0
Expand Down Expand Up @@ -213,7 +214,6 @@ require (
golang.org/x/net v0.0.0-20220325170049-de3da57026de // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
Expand Down
4 changes: 3 additions & 1 deletion pkg/liqoctl/docs/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)

// Options encapsulates the arguments of the docs command.
Expand All @@ -44,7 +46,7 @@ func (o *Options) Run(ctx context.Context) error {
hdrFunc := func(filename string) string {
base := filepath.Base(filename)
name := strings.TrimSuffix(base, path.Ext(base))
title := strings.Title(strings.ReplaceAll(name, "_", " "))
title := cases.Title(language.English).String(strings.ReplaceAll(name, "_", " "))
return fmt.Sprintf("---\ntitle: %q\n---\n\n", title)
}

Expand Down

0 comments on commit b3c6dbd

Please sign in to comment.