Skip to content

krhubert/gotest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
}

About

Test Helpers for Standard Golang Packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages