str

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stringer

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

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

func NewStringer

func NewStringer() *Stringer

NewStringer returns a new Stringer with the default settings. - Comma separator ) "," - Equals symbol "="

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
JackTT - Gopher 🇻🇳