Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( HexdumpCanonical hexdumpCanonicalFlag = true HexdumpNoCanonical hexdumpCanonicalFlag = false )
Variables ¶
This section is empty.
Functions ¶
func Hexdump ¶
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.
Click to show internal directories.
Click to hide internal directories.