kit

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 8 Imported by: 0

README

The kit Package

The kit package provides a set of test packages and helpers to streamline Go testing. Instead of rewriting common test utilities, this package offers a curated collection. Its goal is to balance simplicity and functionality, focusing on practical tools generic.

Sub-packages:

  • iokit - I/O related test helpers.
  • timekit - Time related test helpers.

Documentation

Overview

Package kit provides a set of packages and functions to help with testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGlobalCleanup added in v0.29.0

func AddGlobalCleanup(fn func())

AddGlobalCleanup adds a global cleanup function.

Example usage:

// TestMain is the entry point for running tests in this package.
func TestMain(m *testing.M) {
   // Run all tests and capture the exit code.
   exitCode := m.Run()

   // Cleanup code (runs after all tests).
   kit.RunGlobalCleanups()

   // Exit with the test result code.
   os.Exit(exitCode)
}

func RunGlobalCleanups added in v0.29.0

func RunGlobalCleanups()

RunGlobalCleanups runs global cleanup functions. Guarantees cleanup functions are run only once.

func SHA1File

func SHA1File(pth string) string

SHA1File returns SHA1 hash of the file. Panics on error.

func SHA1Reader

func SHA1Reader(r io.Reader) string

SHA1Reader returns SHA1 hash off everything in the reader. Panics on error.

Types

This section is empty.

Directories

Path Synopsis
Package iokit provides I/O and buffer-related helpers.
Package iokit provides I/O and buffer-related helpers.
Package timekit provides time.Time related helpers.
Package timekit provides time.Time related helpers.

Jump to

Keyboard shortcuts

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