Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(client/debug): correct debug raw-bytes command example (backport #21671) #21676

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs(client/debug): correct debug raw-bytes command example (#21671)
(cherry picked from commit 0fc06f1)

# Conflicts:
#	client/debug/main.go
  • Loading branch information
lilasxie authored and mergify[bot] committed Sep 12, 2024
commit 99392a9b6742954630486f7a2e08a6aa524e251e
8 changes: 8 additions & 0 deletions client/debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,22 @@

func RawBytesCmd() *cobra.Command {
return &cobra.Command{
<<<<<<< HEAD

Check failure on line 301 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected operand, found '<<'

Check failure on line 301 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected expression
Use: "raw-bytes [raw-bytes]",
Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex",
Long: fmt.Sprintf(`Convert raw-bytes to hex.

Example:
$ %s debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]
`, version.AppName),

Check failure on line 308 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ) in composite literal; possibly missing comma or }
Args: cobra.ExactArgs(1),
=======
Use: "raw-bytes <raw-bytes>",
Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex",
Long: "Convert raw-bytes to hex.",
Example: fmt.Sprintf("%s debug raw-bytes '[72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]'", version.AppName),
Args: cobra.ExactArgs(1),
>>>>>>> 0fc06f141 (docs(client/debug): correct `debug raw-bytes` command example (#21671))

Check failure on line 316 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

illegal character U+0023 '#'

Check failure on line 316 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'
RunE: func(_ *cobra.Command, args []string) error {
stringBytes := args[0]
stringBytes = strings.Trim(stringBytes, "[")
Expand All @@ -313,18 +321,18 @@
spl := strings.Split(stringBytes, " ")

byteArray := []byte{}
for _, s := range spl {

Check failure on line 324 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' in composite literal

Check failure on line 324 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' in composite literal

Check failure on line 324 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected operand, found 'range'
b, err := strconv.ParseInt(s, 10, 8)
if err != nil {

Check failure on line 326 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' in composite literal
return err

Check failure on line 327 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected operand, found 'return'

Check failure on line 327 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' in composite literal

Check failure on line 327 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' before newline in composite literal
}

Check failure on line 328 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / dependency-review

missing ',' before newline in composite literal
byteArray = append(byteArray, byte(b))
}
fmt.Printf("%X\n", byteArray)
return nil
},
}

Check failure on line 334 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected }, expected expression
}

Check failure on line 335 in client/debug/main.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: non-declaration statement outside function body

func PrefixesCmd() *cobra.Command {
return &cobra.Command{
Expand Down
Loading