goanytostring

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: CC0-1.0 Imports: 8 Imported by: 2

README

Any to string

Convert any variable to string with various formatting options.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToString

func AnyToString(a any) string

func AnyToStringCustom

func AnyToStringCustom(a any, o Options) string

func AnyToWriter

func AnyToWriter(a any, w io.Writer) error

func AnyToWriterCustom

func AnyToWriterCustom(a any, o Options, w io.Writer) error

func ValueToString added in v1.0.1

func ValueToString(val *reflect.Value) string

func ValueToStringCustom added in v1.0.1

func ValueToStringCustom(val *reflect.Value, o Options) string

func ValueToWriter added in v1.0.1

func ValueToWriter(val *reflect.Value, w io.Writer) error

func ValueToWriterCustom added in v1.0.1

func ValueToWriterCustom(val *reflect.Value, o Options, w io.Writer) error

Types

type Options

type Options struct {
	ArrayStart   string
	ArrayEnd     string
	ArraySep     string
	ByteAsString bool
	MapStart     string
	MapEnd       string
	MapSep       string
	RuneAsString bool
	ShowType     bool
}

func NewOptions

func NewOptions() Options

Jump to

Keyboard shortcuts

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