types

package
v0.0.0-...-5b3a7c8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(v any) bool

IsNil reports whether v is nil.

func ToString

func ToString(v any) string

ToString converts v to a string.

func ToStringE

func ToStringE(v any) (string, error)

ToStringE converts v to a string.

func ToStringSlicePreserveString

func ToStringSlicePreserveString(v any) []string

ToStringSlicePreserveString is the same as ToStringSlicePreserveStringE, but it never fails.

func ToStringSlicePreserveStringE

func ToStringSlicePreserveStringE(v any) ([]string, error)

ToStringSlicePreserveStringE converts v to a string slice. If v is a string, it will be wrapped in a string slice.

func TypeToString

func TypeToString(v any) (string, bool)

TypeToString converts v to a string if it's a valid string type. Note that this will not try to convert numeric values etc., use ToString for that.

Types

type DevMarker

type DevMarker interface {
	DevOnly()
}

DevMarker is a marker interface for types that should only be used during development.

type RLocker

type RLocker interface {
	RLock()
	RUnlock()
}

RLocker represents the read locks in sync.RWMutex.

type Zeroer

type Zeroer interface {
	IsZero() bool
}

Zeroer, as implemented by time.Time, will be used by the truth template funcs in Hugo (if, with, not, and, or).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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