Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrudnik committed Apr 5, 2019
1 parent b38261f commit ba57927
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions cmd/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var parseCmd = &cobra.Command{
Use: "parse",
Use: "parse",
Short: "collection of commands that allow to parse and extract information",
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
Expand Down Expand Up @@ -58,9 +58,9 @@ func doJson(cmd *cobra.Command, data interface{}) error {
}

var parseUriCmd = &cobra.Command{
Use: "uri",
Use: "uri",
Short: "parses the given uri into single parts and returns them as json or formatted template",
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
parsed, err := url.Parse(args[0])

Expand Down Expand Up @@ -89,9 +89,9 @@ var parseUriCmd = &cobra.Command{
}

var parseQueryCmd = &cobra.Command{
Use: "query",
Use: "query",
Short: "parses the given query string and returns them as json or formatted template",
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
// remove leading question mark
in := strings.TrimLeft(args[0], "?")
Expand Down
10 changes: 5 additions & 5 deletions cmd/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import (
)

var pathCmd = &cobra.Command{
Use: "path",
Use: "path",
Short: "collection of commands to modify path related information",
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
},
}

var pathEscapeCmd = &cobra.Command{
Use: "escape",
Use: "escape",
Short: "escapes the given path value and returns the escaped version",
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
out := url.PathEscape(args[0])
output(cmd, out)
},
}

var pathUnescapeCmd = &cobra.Command{
Use: "unescape",
Use: "unescape",
Short: "unescapes the given escaped value and returns the original path value",
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
out, err := url.PathUnescape(args[0])

Expand Down
2 changes: 1 addition & 1 deletion cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

var queryCmd = &cobra.Command{
Use: "query",
Use: "query",
Short: "collection of commands to modify query related information",
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
Expand Down

0 comments on commit ba57927

Please sign in to comment.