util

package
v0.0.0-...-a56da61 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

The util package contains basic string manipulation functions and definitions that could be used anywhere.

The util package should be very simple and make no imports from dexter.

Index

Constants

This section is empty.

Variables

View Source
var AllPlatforms = []string{
	"android", "darwin", "dragonfly", "freebsd",
	"js", "linux", "nacl", "netbsd", "openbsd",
	"plan9", "solaris", "windows", "zos",
}

All values for runtime.GOOS, derived from https://github.com/golang/go/blob/master/src/go/build/syslist.go

View Source
var UnixLike = []string{
	"darwin", "dragonfly", "freebsd",
	"linux", "nacl", "netbsd", "openbsd",
	"plan9", "solaris",
}

A values for runtime.GOOS that are unix-like

Functions

func AppendUnique

func AppendUnique(set1, set2 []string) []string

Merge two string slices, only adding values from set2 that were not already present in set1. The resulting slice will not be unique if there are repeat entries in set1, but repeat entries in set2 will only be appended once.

func StringsInclude

func StringsInclude(set []string, check string) bool

Check if the string in the check variable is a member of the set of strings.

func StringsSubtract

func StringsSubtract(set []string, rm string) []string

Given a slice of strings, return the slice without the string in the rm variable, if it exists in the set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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