From 2e41106866ee7253f800d589a40f61105cec524e Mon Sep 17 00:00:00 2001 From: Solaris-star <820622658@qq.com> Date: Fri, 24 Jul 2026 00:09:25 +0800 Subject: [PATCH] docs: document how to run tests without a go.mod This package intentionally has no module file. Note the temporary `go mod init` workflow and `-vet=off` requirement for local testing (#249). Fixes #249 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 54dfdcb1..e9a0b709 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,16 @@ Before sending a PR, please discuss your change by raising an issue. ## License BSD-2-Clause + +## Running tests + +This package predates modules and intentionally has no `go.mod` (zero dependencies). +From a checkout, initialize a temporary module for local testing: + +```bash +go mod init github.com/pkg/errors +go test -vet=off ./... +``` + +`-vet=off` is needed because a few tests intentionally pass non-constant format +strings into `Wrapf` / `WithMessagef`.