util

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(a, b []string) ([]string, []string)

Diff computes the diff of two string slices a and b, returns a-b and b-a

func IsClosedErr added in v0.11.1

func IsClosedErr(err error) bool

IsClosedErr is a helper function to check for "already closed" errors, which are usually harmless but still show up in logs, code adapted from https://stackoverflow.com/questions/44974984/how-to-check-a-net-conn-is-closed

func Member

func Member(list []string, a string) bool

check is list contains element a

func Remove

func Remove(ss []string, e string) []string

Remove removes a given element from string slice

func Unique

func Unique(s []string) []string

Unique returns unique elements in a string slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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