gotest

module
v0.0.0-...-0bbbf19 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT

README

gotest

Wrappers for functions, in standard go packages, that return an error. The main purpose is to reduce boilerplate for error handling in tests, and make tests more readable.

The package layout is exactly the same as the standard go packages, with the same function names, but with the suffix test added to the package name.

Usage

package main_test

import (
    "testing"

    "github.com/krhubert/gotest/go/ostest"
)

func TestOpenFile(t *testing.T) {
    f := ostest.OpenFile(t, "file.txt")
    defer f.Close()
}

Directories

Path Synopsis
go

Jump to

Keyboard shortcuts

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