stringset

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(strings1, strings2 []string) (extra []string, missing []string, common []string)

Compare performs a set comparison between two slices. `extra` represents elements present in `strings1` but not `strings2`. `missing` represents elements present in `strings2` that are missing from `strings1`. `common` represents elements present in both slices. Since the input slices are treated as sets, duplicates will be removed in any outputs.

func FromSlice

func FromSlice(strings []string) map[string]interface{}

FromSlice converts the given slice to a set in the form of unique keys in a map. The value associated with each key should not be relied upon. A value is present in the set if its key is present in the map, regardless of the key's value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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