overrides

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package overrides provides functionality for reading and writing YAML configuration files that specify error type handling overrides.

The package handles configuration files that allow users to explicitly specify how ambiguous error types should be treated by the errortype analyzer. It supports four categories of error type overrides:

  • Pointer: Types that should always be used as pointers (*PointerError)
  • Value: Types that should always be used as values (ValueError)
  • Suppress: Types for which error diagnostics should be disabled
  • Inconsistent: Types with mixed usage patterns (written to suggestion files)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, suggestions []Override) error

Write serializes the provided overrides suggestions into YAML format and writes it to the given io.Writer.

Types

type Override

type Override struct {
	typeutil.TypeName
	errortypes.ErrorType
}

Override represents a mapping between a Go type and its associated error type. It combines a TypeName with an ErrorType for error handling customization.

func Read

func Read(r io.Reader) ([]Override, error)

Read parses an override file from the provided io.Reader and returns a map associating type names with their corresponding error types. The override file is expected to be in YAML format and structured according to errorfileType.

Jump to

Keyboard shortcuts

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