utilities

module
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: GPL-3.0

README

go.dev reference Go Report Card GitHub License

utilities

Miscellaneous useful commands.

gosh gosh

This is a tool for running Go code from the command line.

See here.

gosh.snippet

This is for installing the standard gosh snippets.

See here

findCmpRm

This finds files with copies, compares them with the copies and optionally deletes the old copies.

See here

findGoDirs

This finds Go source directories and optionally performs some useful tasks on them or just lists them.

See here

mkparamfilefunc

This is intended to be used with go generate to construct functions that can be used to set the parameter files for packages and commands. It will write a Go file with functions that can be passed to a call to paramset.NewOrDie to set the per-command config files. This will allow the user of a program to set parameters that they want to use every time the program is run.

mkpkgerr

This will generate the code to provide a package-specific error type (pkgError) which allows errors from your package to be distinguished from errors from other sources. It defines an interface called Error which will be satisfied only by errors from your package. The pkgError is not exported and so cannot be used outside of the package but does satisfy the package-specific Error interface (and also the standard error interface). It also provides a local pkgErrorf function that can be used to generate a pkgError. The pkgError is a renaming of string and so a string can simply be cast to a pkgError.

mkdoc

This is a tool for generating markdown files documenting Go programs.

See here.

mkbadge

This is a tool for generating badges to be inserted into the README.md file

See here

statfs

This provides an equivalent to the Linux df command but in a form that is easier to use in a shell script. The default output is easy for a human to understand but with the right flags set it can deliver just the value required.

sleepuntil

This provides a way of repeatedly sleeping until a particular time is reached.

See here

timeconv

This provides a way of simply converting the time from one locale to another. This can be useful when you are working with colleagues in other timezones with different daylight-saving rules.

Directories

Path Synopsis
The findCmpRm command finds all files in a given directory with a given extension and compares them against corresponding files without the extension.
The findCmpRm command finds all files in a given directory with a given extension and compares them against corresponding files without the extension.
The findGoCmdDirs command will search for directories containing Go programs and will perform the specified actions - which include printing the directory name or installing the package in the directory.
The findGoCmdDirs command will search for directories containing Go programs and will perform the specified actions - which include printing the directory name or installing the package in the directory.
gosh will take go code entered as a command line parameter and wrap it in a main() function.
gosh will take go code entered as a command line parameter and wrap it in a main() function.
gosh.snippet can be used to install the default snippets or to compare them against the currently installed snippets.
gosh.snippet can be used to install the default snippets or to compare them against the currently installed snippets.
internal
callstack
The callstack package provides a Stack type which can be used to record a callstack and print timings showing how long each function took to run.
The callstack package provides a Stack type which can be used to record a callstack and print timings showing how long each function took to run.
stdparams
The stdparams package provides functions that can be used to ensure commonality of behaviour of parameters in programs across the utilities suite.
The stdparams package provides functions that can be used to ensure commonality of behaviour of parameters in programs across the utilities suite.
mkbadge will print out the text of the badges you should add to the README file.
mkbadge will print out the text of the badges you should add to the README file.
mkdoc will generate markdown files for any command that is using the param.mod/param module.
mkdoc will generate markdown files for any command that is using the param.mod/param module.
The mkfunccontrolparamtype is intended for generating a file containing a type suitable for controlling the behaviour of a function.
The mkfunccontrolparamtype is intended for generating a file containing a type suitable for controlling the behaviour of a function.
The mkparamfilefunc command is intended for use with go generate and will make the standard functions for setting the config files.
The mkparamfilefunc command is intended for use with go generate and will make the standard functions for setting the config files.
The mkpkgerr command is intended for generating a package-specific error type similar to the runtime.Error type.
The mkpkgerr command is intended for generating a package-specific error type similar to the runtime.Error type.
The sleepuntil program will sleep up to a specified time and then either exit or else perform some specified action.
The sleepuntil program will sleep up to a specified time and then either exit or else perform some specified action.
The statfs program provides a command line interface to the statfs system call and can report the values in a form convenient for use in shell scripts.
The statfs program provides a command line interface to the statfs system call and can report the values in a form convenient for use in shell scripts.
The timeconv program will display the time given in one timezone in another.
The timeconv program will display the time given in one timezone in another.

Jump to

Keyboard shortcuts

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