httpapitest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 6 Imported by: 0

README

httpapitest

import "github.com/brpaz/lib-go/httpapi/httpapitest"

Package httpapitest provides test helpers for the httpapi package.

Index

func AssertFieldError

func AssertFieldError(t testing.TB, resp *http.Response, field, code string)

AssertFieldError asserts that resp contains a JSON ValidationErrorResponse with a field error matching field and code. The response body is restored after reading so callers can still decode it.

Generated by gomarkdoc

Documentation

Overview

Package httpapitest provides test helpers for the httpapi package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFieldError

func AssertFieldError(t testing.TB, resp *http.Response, field, code string)

AssertFieldError asserts that resp contains a JSON ValidationErrorResponse with a field error matching field and code. The response body is restored after reading so callers can still decode it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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