toolsnaps

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package toolsnaps provides test utilities for ensuring json schemas for tools have not changed unexpectedly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(toolName string, tool any) error

Test checks that the JSON schema for a tool has not changed unexpectedly. It compares the marshaled JSON of the provided tool against a stored snapshot file. If the UPDATE_TOOLSNAPS environment variable is set to "true", it updates the snapshot file instead. If the snapshot does not exist and not running in CI, it creates the snapshot file. If the snapshot does not exist and running in CI (GITHUB_ACTIONS="true"), it returns an error. If the snapshot exists, it compares the tool's JSON to the snapshot and returns an error if they differ. Returns an error if marshaling, reading, or comparing fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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