util

package
v0.0.0-...-3c753f8 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Unlicense Imports: 14 Imported by: 0

Documentation

Overview

debug is print with debuglevels

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToClipboard

func CopyToClipboard(text string) error

CopyToClipboard is for macOS

func CurrFuncName

func CurrFuncName() string

CurrFuncName print out func for use int fmt.Printf and debug texts

func Debugf

func Debugf(format string, a ...any)

Debugf prints if Debuglvl more then 10

func Dirname

func Dirname() string

Dirname is a port of __dirname in node

func FileCopy

func FileCopy(sourcename, destinationname string) error

FileCopy copies one file

func FileExists

func FileExists(path string) bool

FileExists check if a file exists

func Infof

func Infof(format string, a ...any)

Debugf prints if Debuglvl more then 5

func PanicIf

func PanicIf(b bool, format string, v ...any)

PanicIf short for if b {panic()} don't for get to change the func name to most

func PathInputShared

func PathInputShared(year, day, catalog, filename string) string

PathInputShared get the path from input files in the shared input catalog

func PathInputStandalone

func PathInputStandalone(year, day, filename string) string

PathInputStandalone return filepath for inputfiles used by standalone aoc solutions (solution with main package)

func PreviewInput

func PreviewInput(input string, lines int) string

PreviewInput a long input string

func ReadFile

func ReadFile(pathFromCaller string) string

ReadFile is a wrapper over io/ioutil.ReadFile but also determines the dynamic absolute path to the file.

Deprecated in favor of go:embed, refer to scripts/skeleton/tmpls

func Run

func Run(command string, arg ...string)

Run execute a external command end program on fail

func SetDebuglvl

func SetDebuglvl(n int)

SetDebuglvl 1-10 5=info 10=debug

func SetTimer

func SetTimer() func() time.Duration

SetTimer Set a timmer and return a func that returns time.Duration from the timer func main() { stopTimer := SetTimer() ... fmt.Printf("Elapsed time:%v\n".stopTimer())

func ShardInputFile

func ShardInputFile(inputpath string) string

ShardInputFile read shared (input files in input catalog) and return as a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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