An open API service indexing awesome lists of open source software.

https://github.com/nickwells/utilities

miscellaneous useful commands, including 'gosh' the Go scripting tool
https://github.com/nickwells/utilities

go golang gosh

Last synced: 5 months ago
JSON representation

miscellaneous useful commands, including 'gosh' the Go scripting tool

Awesome Lists containing this project

README

          

[![go.dev reference](https://img.shields.io/badge/go.dev-reference-green?logo=go)](https://pkg.go.dev/mod/github.com/nickwells/utilities)
[![Go Report Card](https://goreportcard.com/badge/github.com/nickwells/utilities)](https://goreportcard.com/report/github.com/nickwells/utilities)
![GitHub License](https://img.shields.io/github/license/nickwells/utilities)

# utilities
Miscellaneous useful commands.

## gosh ![gosh](gosh/_images/gosh.100x100.gif)
This is a tool for running Go code from the command line.

[See here](gosh/_gosh.DOC.md).

## gosh.snippet
This is for installing the standard gosh snippets.

[See here](gosh.snippet/_gosh.snippet.DOC.md)

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

[See here](findCmpRm/_findCmpRm.DOC.md)

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

[See here](findGoDirs/_findGoDirs.DOC.md)

## 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.NewOrPanic 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.

[See here](mkparamfilefunc/_mkparamfilefunc.DOC.md)

## 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.

[See here](mkpkgerr/_mkpkgerr.DOC.md)

## mkfunccontrolparamtype
This can be used to generate a type which can be used to control the
behaviour of a function. You can give a type name, a list of valid values and
a description and it will generate a file containing the necessary code that
you can then use.

The type can be thought of as an enumerated type.

[See here](mkparamfilefunc/_mkparamfilefunc.DOC.md)

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

[See here](mkdoc/_mkdoc.DOC.md).

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

[See here](mkbadge/_mkbadge.DOC.md)

## 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.

[See here](statfs/_statfs.DOC.md)

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

[See here](sleepuntil/_sleepuntil.DOC.md)

## 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.

[See here](timeconv/_timeconv.DOC.md)