utils

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEachLineInFile added in v1.17.0

func ForEachLineInFile(path string, cb func(line string) error) error

ForEachLineInFile runs cb over all lines in a file

func Input added in v1.16.0

func Input(path string) string

Input is used for flags, which accept input in any form. Input supports HTTP and HTTPS resources, file paths and stdin.

func Output added in v1.16.0

func Output(path string, lines []string, append bool)

Output is used for flags, which accept output paths. If append is true, the output will be appended to the file at path.

func SliceContainsString added in v1.16.0

func SliceContainsString(s []string, e string) bool

SliceContainsString checks if a slice contains a string

func UniqueIntSlice added in v1.18.0

func UniqueIntSlice(intSlice []int) []int

UniqueIntSlice removes duplicates from a slice

func UniqueStringSlice added in v1.18.0

func UniqueStringSlice(stringSlice []string) []string

UniqueStringSlice removes duplicates from a slice

func WriteFile added in v1.15.0

func WriteFile(path string, content []byte, append bool)

WriteFile writes content to path. If append is true, the content will be appended to the file at path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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