tool

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(names []string, name string) bool

Contains checks if name is in names.

func ContainsPartialsOnly

func ContainsPartialsOnly(partialNames []string, testedString string) (contains bool)

ContainsPartialsOnly checks if testedString has a part of in partialNames list.

func EqualClassical

func EqualClassical(lhs, rhs reflect.Value) bool

EqualClassical tests lhs and rhs is equal.

func FindInSlice

func FindInSlice(ns reflect.Value, elv typ.Any, i int) (found bool)

FindInSlice finds a value elv is in array ns.

func InspectStruct

func InspectStruct(v typ.Any)

InspectStruct dumps wach field in a struct with its reflect information.

func MinInt

func MinInt(a, b int) int

MinInt returns min-value of a and b.

func PartialContains

func PartialContains(names []string, partialNeedle string) (index int, matched string, contains bool)

PartialContains checks if one of names has partialNeedle as a part.

func PartialContainsShort

func PartialContainsShort(names []string, partialNeedle string) (contains bool)

PartialContainsShort checks if one of names has partialNeedle as a part.

func PointerTo added in v0.2.51

func PointerTo(t reflect.Type) reflect.Type

PointerTo returns the pointer type of element t. For example, if t represents type Foo, PointerTo(t) represents *Foo.

func PtrOf

func PtrOf(tgt reflect.Value) reflect.Value

func ReverseAnySlice

func ReverseAnySlice(s typ.Any)

ReverseAnySlice reverse any slice/array.

func ReverseSlice

func ReverseSlice(s interface{})

ReverseSlice reverse any slice/array.

func ReverseStringSlice

func ReverseStringSlice(s []string) []string

ReverseStringSlice reverse a string slice.

func StripQuotes added in v1.0.2

func StripQuotes(s string) string

StripQuotes strips first and last quote char (double quote or single quote).

func TrimQuotes added in v1.0.2

func TrimQuotes(s string) string

TrimQuotes strips first and last quote char (double quote or single quote).

Types

type String

type String string

func (String) Split

func (s String) Split(sep string) []string

Jump to

Keyboard shortcuts

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