must

package
v2.18.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package must implements helper functions for testing to eliminate some error checking boilerplate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoReq

func DoReq(t *testing.T, client *http.Client, req *http.Request) *http.Response

DoReq makes an HTTP request and fails the test if there is an error.

func ReadAll

func ReadAll(t *testing.T, r io.Reader) string

ReadAll reads all bytes from an io.Reader and fails the test if there is an error.

func Unmarshal

func Unmarshal[T any](t *testing.T, r io.Reader) T

Unmarshal unmarshals JSON from an io.Reader into a value and fails the test if there is an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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