errlast

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 6 Imported by: 0

README

yze-go-errlast

A yze analyzer (category errors) enforcing the gomatic Go idiom that error is always the last return value. The convention is a contract on any signature returning an error, so it is checked on function and method declarations, interface method signatures, function literals, and function-typed definitions alike.

  • Rule: yze/errlast
  • Library: exports Analyzer and Registration for the yze aggregator and stickler runner.
  • Binary: cmd/yze-go-errlast runs it standalone (text/-json, and as a go vet -vettool).

Built on the go-yze framework.

Documentation

Overview

Package errlast provides a go/analysis analyzer enforcing the gomatic Go idiom that error is always the last return value.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "errlast",
	Doc:      "reports error return values that are not last",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer reports error results that are not the last return value.

View Source
var Registration = goyze.Registration{
	Name:       "errlast",
	Categories: []goyze.Category{"errors"},
	URL:        "https://docs.gomatic.dev/yze/errlast",
	Analyzer:   Analyzer,
}

Registration declares this analyzer to the yze framework.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
yze-go-errlast command
Command yze-go-errlast runs the errlast analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).
Command yze-go-errlast runs the errlast analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).

Jump to

Keyboard shortcuts

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