util

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInteger added in v0.2.9

func DecodeInteger(key string) int

func EncodeInteger added in v0.2.9

func EncodeInteger(key int) string

func FileExists

func FileExists(filename string) bool

FileExists - takes a filename, returns bool

func Filter

func Filter(vs []string, f func(string) bool) []string

Filter - accept slice of string, return slice with only those entries that return true to passed function

func IntSliceToCSV

func IntSliceToCSV(ns []int) string

IntSliceToCSV - convert a slice of integers into a CSV string

func JSONMarshalNoEscape

func JSONMarshalNoEscape(t interface{}) ([]byte, error)

func StringsDiff added in v0.2.10

func StringsDiff(a, b []string) (diff []string)

StringsDiff - set difference, result is A - B

func UniqueInts

func UniqueInts(input []int) []int

UniqueInts returns a unique subset of the int slice provided.

Types

type CustomLogFormat added in v0.2.3

type CustomLogFormat struct{}

func (*CustomLogFormat) Format added in v0.2.3

func (lf *CustomLogFormat) Format(entry *log.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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