common

package
v0.0.0-...-d95a457 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbeddedLines

func EmbeddedLines(inputs []string) []string

EmbeddedLines returns a sorted slice of lines that are common in every input string when the string is split by \n. That is, the input string has embedded newlines.

Types

type StringPop

type StringPop struct {
	String string
	Count  int
}

StringPop is a struct containing a string and it's corresponding count (population).

func Strings

func Strings(input []string) []StringPop

Strings returns an descending order slice of StringPop with each StringPop containing a line and the corresponding amount of times it it occurs in the input slice.

type StringPops

type StringPops []StringPop

func (StringPops) Len

func (l StringPops) Len() int

func (StringPops) Less

func (l StringPops) Less(i, j int) bool

func (StringPops) Swap

func (l StringPops) Swap(i, j int)

Jump to

Keyboard shortcuts

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