string

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: BSD-3-Clause Imports: 0 Imported by: 0

README

go-string

There are many string libraries. This one is mine.

Install

You will need to have both Go (specifically version 1.12 or higher because we're using Go modules) and the make programs installed on your computer. Assuming you do just type:

make tools

All of this package's dependencies are bundled with the code in the vendor directory.

Example

package main

import (
	"fmt"
	"github.com/aaronland/go-string/random"
)

func main() {

	opts := random.DefaultOptions()
	opts.Length = 40
	opts.Chars = 20

	s, _ := random.String(opts)

	fmt.Println(s)
}

Error handling omitted for the sake of brevity.

Tools

randomstr
./bin/randomstr -h
Usage of ./bin/randomstr:
  -alphanumeric
    	Only include alpha-numeric characters (this causes the -ascii flag to be set to true)
  -ascii
    	Only include ASCII characters
  -chars int
    	Minimum length of the random string, in characters
  -length int
    	Minimum length of the random string, in bytes (default 32)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
randomstr command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL