Categorygithub.com/kirilldanshin/myutils
modulepackage
0.0.0-20160713214838-182269b1fbcc
Repository: https://github.com/kirilldanshin/myutils.git
Documentation: pkg.go.dev

# README

myutils

My Go utils

# Functions

Concat some strings.
CPUProf runs the profiler and returns a function you need to defer.
First returns first argument of a function return use it like myutils.First(ab()).
Last returns first argument of a function return use it like myutils.Last(ab()).
LogFatalError it's a snippet for if err != nil { log.Fatalf("Error: %s", err) }.
NewSyncPrinter initialize a new SyncPrinter.
Pick returns picked argument of a function return use it like myutils.Pick(1, ab()).
RequiredStrFatal it's a snippet for if str == "" { log.Fatalf("Error: %s is empty", name) }.
Slice returns arguments of a function return as a slice use it like myutils.Slice(ab())[1].
StrCrop crops a string like you want in blog previews.

# Structs

SyncPrinter is a thread-safe printer.