strutil

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertKVStringsToMap

func ConvertKVStringsToMap(values []string) map[string]string

ConvertKVStringsToMap is from https://github.com/moby/moby/blob/v20.10.0-rc2/runconfig/opts/parse.go

ConvertKVStringsToMap converts ["key=value"] to {"key":"value"}

func DedupeStrSlice

func DedupeStrSlice(in []string) []string

func InStringSlice

func InStringSlice(ss []string, str string) bool

InStringSlice checks whether a string is inside a string slice. Comparison is case insensitive.

From https://github.com/containerd/containerd/blob/7c6d710bcfc81a30ac1e8cbb2e6a4c294184f7b7/pkg/cri/util/strings.go#L21-L30

func ParseCSVMap added in v0.7.3

func ParseCSVMap(s string) (map[string]string, error)

ParseCSVMap parses a string like "foo=x,bar=y" into a map

func TrimStrSliceRight added in v0.8.0

func TrimStrSliceRight(base, extra []string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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