Help us shape the future of Go! Take the 2026 Go Developer Survey

compat

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package compat is filex's compatibility window for what storage plugins and apps send it.

⚠⚠ The rule (docs/CONTRIBUTING.md → "Compatibility window for plugins and apps"): when a newer form replaces an old one - a signature format, a manifest field, a bridge call, a host function - the old form keeps working, with a warning, for at least Rule.Minors minor releases and Rule.Months months, whichever is longer, counted from the release that shipped the replacement. A plugin or an app published (built, signed) for that release therefore runs unchanged through the window. Only after it may a release refuse the old form, and only when the CHANGELOG of an earlier, published release announced that removal.

windows.json is the one place a window is written. The code that still accepts an old form reads its end from here (Get, Window.Until), the sentences that name the end take it as {version} and {date}, and web/tests/docs/compatWindow.test.ts holds the docs and the CHANGELOG to the same numbers. A window is never deleted: the release that finally refuses the old form sets `removed` (and `announced`, the earlier release whose CHANGELOG said so), which the test checks against the rule.

Index

Constants

View Source
const DateLayout = "2006-01-02"

DateLayout is how a window's dates are written (ISO 8601, a day).

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	Minors int `json:"minors"`
	Months int `json:"months"`
}

Rule is how long an old form stays accepted: Minors minor releases or Months months after the release that replaced it, whichever is longer.

func CurrentRule

func CurrentRule() Rule

CurrentRule is the rule every window is measured with.

type Window

type Window struct {
	// ID names the form for code, docs and the CHANGELOG
	// ("storage-build-signature-sha256").
	ID string `json:"id"`
	// Form says what the old form is, in one English sentence.
	Form string `json:"form"`
	// Since is the minor release that shipped the replacement ("0.55") and
	// SinceDate that release's date ("2026-10-09"); the window counts from
	// them.
	Since     string `json:"since"`
	SinceDate string `json:"since_date"`
	// Docs is the page and anchor that describe the form, from the
	// repository root.
	Docs string `json:"docs"`
	// Announced is the release whose CHANGELOG announced the removal, and
	// Removed the release that refuses the old form; both empty while it is
	// accepted.
	Announced string `json:"announced,omitempty"`
	Removed   string `json:"removed,omitempty"`
	// contains filtered or unexported fields
}

Window is one old form that is still accepted (or, once Removed is set, the record of when it stopped being).

func All

func All() []Window

All is every window, in the file's order.

func Get

func Get(id string) Window

Get is the window of one old form. An unknown id is a defect in the code that asks (it names a form windows.json does not hold): Get panics, and the asking package's tests reach it.

func (Window) Open

func (w Window) Open(release string, on time.Time) bool

Open reports whether a release (its version and date) must still accept the old form: it is older than Until's version, or dated before Until's date.

func (Window) Until

func (w Window) Until() (version, date string)

Until is the end of the window: version is the earliest minor release that may refuse the old form ("0.61"), date the day before which no release refuses it ("2027-10-09"). The later of the two holds.

Jump to

Keyboard shortcuts

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