Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rev ¶
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.
Click to show internal directories.
Click to hide internal directories.