These are preparations of canned code for all occasions. Might come in handy sometime.

  • By Constantine Zavezeon
  • Last update: Dec 27, 2022
  • Comments: 0


These are preparations of canned code for all occasions. Might come in handy sometime.
GoDoc Go Report Card GitHub Coverage

This repository is under development.

Detailed description

In any business, every master has a set of good tools, and coders have their own tools too.
There are two large categories of tools: the first one we use constantly, every day and they wander from one project to another, and the second type of tools we use rarely, in cases of emergency.
All these tools are well-established and tested, they are fast, efficient and safe.
I decided to build my own box of tool code so that the code would be available at all times.

You can quickly connect all the tools from this set

go get

In your Go code, connect the blanks like this:

import ""

When you stop using this package, do not forget to get rid of unnecessary dependencies in your project

go mod tidy

This package does not require separate documentation, as it is a collection of various powerful functions and each function has a description.

If you want to increase the efficiency of your code, then you will need to take individual functions and copy them into your project.
To do this, you will need to first copy the entire repository to yourself.

git clone

This package has two files ordinary.go for commonly used functions and curiosity.go for functions that are rarely needed.

You can also contribute to this repository through a pull request and this toolbox will be our shared one.
If you want to add your own function to the repository, don't forget to write a test and a benchmark.
You can create your own file, for example <your_name>.go and <your_name>_test.go for testing (benchmarking).
Whatever the name of your file, the package must have the title package preserves.

Check out the documentation

Look at the documentation in two steps.
First, in the console, run:

godoc -http=:8080

And then in your web browser navigate to the uri:


The godoc utility may not be present in your Go build and you may need to install it
command go get -v

You can also use Go's standard functionality to view documentation in the console via go doc.
For example:

go doc GenerateId

If your IDE is good enough, then the documentation for functions and methods will be available from your code editor.


Run tests:

go test -v

Run tests showing code coverage:

go test -cover -v

You can view code coverage in detail in your web browser.
To do this, you need to sequentially execute two commands in the console:

go test -coverprofile="coverage.out" -v
go tool cover -html="coverage.out"


You can look at code performance tests:

go test -benchmem -bench="." curiosity.go curiosity_test.go


go test -benchmem -bench="." ordinary.go ordinary_test.go

back to top

About the author

The author of the project is Constantine Zavezeon (Kwynto).
You can contact the author by e-mail: [email protected]
The author accepts proposals for participation in open source projects,
as well as willing to accept job offers.

back to top