This repository contains utility functions that do not make sense in other packages.

Overview

Installation

go get github.com/IQ-tech/go-utils

Executing code before process exits

AtInterruption receives a function that will be called once before the process exits.
AtInterruption can be called many times with different functions and each function will be called once.

utils.AtInterruption(func() {
	log.Printf("Closing DB Connection.")
	db.Close()

	log.Printf("Shutting down New Relic application.")
	nrl.Shutdown(5 * time.Second)
})

Logging and terminating the process on error

EndAsErr will log the error message and terminate the process if err is not nil

func main() {
	di := setup.Start()
	err := server.Start(di)
	utils.EndAsErr(err, "Could not start the server.", di.Log.InfoWriter(), di.Log.ErrorWriter())
}
You might also like...
Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts.

Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts. Sometimes is needed to parse the content of the issue for some data extraction or statistics purposes.

Command not found? Install it right there!
Command not found? Install it right there!

Tii On most GNU/Linux systems, when a command is not found, a message showing what can be run to install the command is printed.

A command-line tool that uses a fake AI neural network to tell whether or not Ben is sus

Is ben sus? Let's use an AI neural network, trained by his own tweets to figure out. A command-line tool that uses a fake AI neural network to tell wh

Gostall - Run go install ./cmd/server and not have the binary install in your GOBIN be called server?

GOSTALL Ever wanted to run go install ./cmd/server and not have the binary insta

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves
go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

A Go package for converting RGB and other color formats/colorspaces into DMC thread colors (DMC color name and floss number)

go-c2dmc A Go package for converting RGB and other color formats/colorspaces into DMC thread colors (DMC color name and floss number). Implemented as

Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms INSTALLATION DESCRIPTION OPTIONS CONFIGURATION OUTPUT TEMPLATE FORMAT SELECTION

An os/exec like interface for running a command in a container, and being able to easily interact with stdin, stdout, and other adjustments

dockerexec An "os/exec" like interface for running a command in a container, and being able to easily interact with stdin, stdout, and other adjustmen

JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具

job make your short-term command as a long-term job Install Shell Install (Linux & MacOS) # binary will be $(go env GOPATH)/bin/job $: curl -sfL https

Releases(v0.0.1)
Owner
IQ Tech
IQ Tech
This repository contains gRPC server and client

link Данный репозиторий содержит gRPC сервер и клиент. Запуск Сервер Сервер офор

null 1 Dec 20, 2021
This repository contains example apps created using GoCondor framework

Examples This repository contains example apps created using GoCondor framework what are the examples? 1- Todo API A todo api with the below routes:

Go Condor 0 May 7, 2021
This GitHub repository contains code example for those who are new to go programming.

Go-examples This GitHub repository contains code example for those who are new to go programming. IMPLEMENTATIONS JWT - json-web-token-implementation/

Sabuhi Gurbani 0 Jan 15, 2022
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Rohit Gupta 2.1k Nov 28, 2022
:mag: Search the Go packages via command-line

GoSearch Search the Go packages for pkg.go.dev via command-line. It supports all search options in Search Help. Installation go get github.com/mingram

MinJae Kwon 53 Jun 23, 2022
It is an easy and fast tool to install your packages with just one command.

Trouxa It is an easy and fast tool to install your packages with just one command. What means "Trouxa"? In portuguese, Trouxa means something like a "

Baianoware 7 Sep 29, 2022
Get Brew Packages to update, just like you've experienced from Ubuntu

Get the number of Brew Packages to update, just like you've experienced from Ubuntu BrewUpdate is a simple utility written in Go, notify you how many

YeonGyu-Kim 13 Nov 6, 2021
Code generator to produce CLI from R packages

cmd Create command line applications from R packages. How it works It's a code generator that outputs Go code which produces a Command Line Applicatio

Opifex 7 Apr 30, 2022
Gopkg - Search go.dev packages by keyword

gopkg Search go.dev packages by keyword Usage Install go install github.com/luck

null 1 Apr 6, 2022
lls is lightweight ls. Using lls, you can get a list of files in a directory that contains a large number of files.

lls lls is lightweight ls. Using lls, you can get a list of files in a directory that contains a large number of files. How? You allocate a buffer for

Tatsuya Kaneko 58 Nov 3, 2022