command

package module
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 2 Imported by: 0

README

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rev

func Rev(_ ...any) gloo.Command[[]byte, []byte]

Rev returns a command that reverses each input line character by character.

Example
package main

import (
	"fmt"

	"github.com/gloo-foo/testable"

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

func main() {
	lines, _ := testable.TestLines(command.Rev(), "hello\nworld\n")
	for _, line := range lines {
		fmt.Println(line)
	}
}
Output:
olleh
dlrow
Example (Unicode)
package main

import (
	"fmt"

	"github.com/gloo-foo/testable"

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

func main() {
	lines, _ := testable.TestLines(command.Rev(), "日本語\n")
	for _, line := range lines {
		fmt.Println(line)
	}
}
Output:
語本日

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