driftguard

package
v1.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 0 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 driftguard holds the tests that keep a parser struct field from being added in one place and forgotten in the others.

A field on a parser type has to be handled in several independent places: the hand-built slow MarshalJSON path, the structural hasher, each type's equality function, and the joiner's schema comparison. Nothing connected them, so a field could be added, tested and shipped while silently vanishing from JSON documents that carried an extension, or while leaving two different schemas looking identical. That is issue #397, and #414 found nine more fields in the same state afterwards.

The guards live here, in one internal package with no exported symbols, rather than spread across the packages they exercise. Keeping them together means the reflection helper they share is not a maintained API for anyone else, and the list of deliberate exclusions sits next to the checks that honor it.

Everything is in _test.go files; this file exists only to give the package a clause and a home for this explanation.

Jump to

Keyboard shortcuts

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