stringer

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveDuplicateStrings added in v0.7.0

func RemoveDuplicateStrings(list []string) []string

RemoveDuplicateStrings returns a sorted list with no duplicates. Case matters.

func RemoveDuplicateStringsAndTitle added in v0.7.0

func RemoveDuplicateStringsAndTitle(list []string) []string

RemoveDuplicateStringsAndTitle converts the names to lowercase and returns a sorted list with no duplicates and the first letter capitalised.

Types

type Stringer

type Stringer struct {
	strings.Builder
	// contains filtered or unexported fields
}

Stringer extends strings.Builder with varargs-based write methods.

func New

func New() *Stringer

func (*Stringer) SetComma

func (s *Stringer) SetComma(c byte) *Stringer

SetComma sets the symbol to use for joining slices and map k-v pairs.

func (*Stringer) SetEquals

func (s *Stringer) SetEquals(e byte) *Stringer

SetEquals sets the symbol to join keys and values in maps.

func (*Stringer) SetMapComma

func (s *Stringer) SetMapComma(b bool) *Stringer

SetMapComma enables adding a comma between elements in supplied maps.

func (*Stringer) SetSliceComma

func (s *Stringer) SetSliceComma(b bool) *Stringer

SetSliceComma enables adding a comma between elements in supplied slices.

func (*Stringer) WriteI

func (s *Stringer) WriteI(v ...interface{}) (int, error)

WriteI writes any number of different types at once. Special notes: Integers - int and int64 are the only approved types, and untyped whole numbers will be parsed as int Floating point numbers - all numbers with a decimal point are interpreted as float64, with the fewest necessary decimal places Maps & slices - commas are not on by default, and maps will have "=" between each key-value pair

func (*Stringer) WriteStrings

func (s *Stringer) WriteStrings(v ...string) (int, error)

WriteStrings writes any number of strings in one go.

Jump to

Keyboard shortcuts

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