command

package module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 4 Imported by: 0

README

Documentation

Index

Examples

Constants

View Source
const (
	HexdumpCanonical   hexdumpCanonicalFlag = true
	HexdumpNoCanonical hexdumpCanonicalFlag = false
)

Variables

This section is empty.

Functions

func Hexdump

func Hexdump(opts ...any) gloo.Command[[]byte, []byte]

Hexdump returns a command that produces a hex dump of each input line.

Default: space-separated hex bytes for each line. With HexdumpCanonical (-C): offset, hex bytes with midpoint gap, and ASCII sidebar.

Example
package main

import (
	"fmt"
	"strings"

	"github.com/gloo-foo/testable"

	command "github.com/gloo-foo/cmd-hexdump"
)

func main() {
	lines, _ := testable.TestLines(command.Hexdump(), "Hello\n")
	fmt.Println(strings.Join(lines, "\n"))
}
Output:
48 65 6c 6c 6f
Example (Canonical)
package main

import (
	"fmt"
	"strings"

	"github.com/gloo-foo/testable"

	command "github.com/gloo-foo/cmd-hexdump"
)

func main() {
	lines, _ := testable.TestLines(command.Hexdump(command.HexdumpCanonical), "Hi\n")
	fmt.Println(strings.Join(lines, "\n"))
}
Output:
00000000  48 69                                             |Hi|

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL