Documentation ¶
Overview ¶
Package list provides the list command run function.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTable = errors.New("could not display the table") ErrIANA = errors.New("could not work out the IANA index or MIME type") )
Functions ¶
func Printable ¶
Printable reports whether the named encoding can be shown as a 256 character table. UTF-16 and UTF-32 are not printable.
func Table ¶
Table writes one or more named encodings as a formatted table.
Example ¶
package main import ( "fmt" "log" "os" "strings" "github.com/bengarrett/retrotxtgo/cmd/list" "github.com/gookit/color" ) func main() { color.Enable = false names := []string{"cp437"} s := strings.Builder{} if err := list.Table(&s, names...); err != nil { log.Fatal(err) } fmt.Fprintf(os.Stdout, "%d characters in the table", len(s.String())) }
Output: 1693 characters in the table
func Tables ¶
Tables writes all the supported encodings as formatted tables.
Example ¶
package main import ( "fmt" "log" "os" "strings" "github.com/bengarrett/retrotxtgo/cmd/list" "github.com/gookit/color" ) func main() { color.Enable = false s := strings.Builder{} if err := list.Tables(&s); err != nil { log.Print(err) } const val = 70000 l := s.Len() fmt.Fprintf(os.Stdout, "characters > 70000: %v", l > val) }
Output: characters > 70000: true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.