You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cointop/vendor/github.com/willf/pad/README.md

1.1 KiB

pad

Join the chat at https://gitter.im/willf/pad

Build Status

A golang implementation of the left-pad javascript library

I was inspired by Stew's left-cats, who was inspired by this article, to port this to Go.

This implementation will let you pad byte-strings and UTF-8 encoded strings

example usage:

package main

import (
	"fmt"

	"github.com/willf/pad"
	padUtf8 "github.com/willf/pad/utf8"
)

func main() {
	fmt.Println(pad.Right("Hello", 20, "!"))
	fmt.Println(padUtf8.Left("Exit now", 20, "→"))
}
> go run example.go
Hello!!!!!!!!!!!!!!!
→→→→→→→→→→→→Exit now