Documentation
¶
Overview ¶
Package estimatelaws embeds the dataset "U.S. State Auto Repair Estimate Laws": one record for each of the 50 states and the District of Columbia, describing the state law or regulation on written auto repair estimates.
This is not legal advice. Verify the official text before relying on any record: laws change, and a short summary can miss exceptions. A Verified record carries the citation and the URL of the source to read.
Only records whose Status is Verified carry rule values. They were read on an official state source. For a NoStatuteFound record, an official source was read on the date given and no dedicated statute was found (OfficialURL, CheckedOn); an absence cannot be proven by quotation. For a Lead record, the official text was not read; any citation or reference kept in the record is a pointer to follow up, and the rule fields are empty. An empty field means "not established from the source read"; it never means "no rule".
The dataset is compiled and published by RepairWorth:
- state-by-state table: https://repairworth.com/car-repair-estimate/
- data sources: https://repairworth.com/data-sources/
- publisher: https://repairworth.com/
The code is under the MIT license. The embedded data, in the data directory, is under Creative Commons Attribution 4.0 International.
Index ¶
Examples ¶
Constants ¶
const Version = "2026-10-02"
Version is the release date of the embedded dataset: the most recent CheckedOn date found in it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Law ¶
type Law struct {
State string // jurisdiction name
Code string // two-letter USPS code
Status Status
HasStatute string // "yes" or "partial" (Verified), "no" (NoStatuteFound), "" (Lead)
StatuteCitation string
OfficialURL string
SecondaryURL string // legal mirror, never used as evidence
WrittenEstimateRequired string
// WrittenEstimateThresholdUSD is meaningful only when HasThreshold is true.
WrittenEstimateThresholdUSD int
HasThreshold bool
OverrunWithoutNewConsent string
ConsentForm string
ReturnOfReplacedParts string
ShopRegistrationRequired string
DiagnosticOrTeardownFeeDisclosure string
VerifiedQuote string // verbatim quote from the official source
CheckedOn string // ISO 8601 date of the reading or of the search
EffectiveVersion string
Note string
}
Law is one row of the dataset. Text fields hold the wording of the dataset; an empty string means "not established from the source read".
func All ¶
func All() []Law
All returns every record, in the order of the dataset. The slice is a copy: the caller may modify it.
Example ¶
fmt.Println(len(All()), "jurisdictions, release", Version)
Output: 51 jurisdictions, release 2026-10-02
func Lookup ¶
Lookup returns the record for a two-letter USPS code such as "CA" or "DC". The code is matched without regard to case or surrounding spaces.
Example ¶
law, ok := Lookup("ca")
if !ok {
return
}
fmt.Println(law.State)
fmt.Println(law.Status)
fmt.Println(law.StatuteCitation)
Output: California verified Cal. Bus. & Prof. Code §9884.9
type Status ¶
type Status string
Status says how far a record can be relied on.
const ( // Verified: the official text was read and the record names a statute or rule. Verified Status = "verified" // NoStatuteFound: an official source was read on the date given and no // dedicated statute was found. NoStatuteFound Status = "no_statute_found" // Lead: the official text was not read; any citation or reference kept // in the record is a pointer to follow up, and the rule fields are empty. Lead Status = "lead" )