Skip to content

Go package providing methods for creating and manipulating common string types.

License

Notifications You must be signed in to change notification settings

aaronland/go-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-string

Go package providing methods for creating and manipulating common string types.

There are many string libraries. This one is mine.

Documentation

Go Reference

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)

About

Go package providing methods for creating and manipulating common string types.

Resources

License

Stars

Watchers

Forks

Packages

No packages published