ptrparam

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: 7 Imported by: 0

README

yze-go-ptrparam

A yze analyzer (group go, category immutability) enforcing the gomatic Go immutability standard: function parameters are passed by value, never by pointer, unless the pointed-to type is a standard-library type where a pointer is the idiomatic calling convention (*slog.Logger, *testing.T, *http.Request, *sql.DB, …).

  • Rule: yze/go/ptrparam
  • Binary: cmd/yze-go-ptrparam runs it standalone (text/-json, and as a go vet -vettool).

Built on the go-yze framework. The allow-list is baked in for v1; a configurable -allow flag is planned.

Documentation

Overview

Package ptrparam provides a go/analysis analyzer enforcing the gomatic Go immutability standard: function parameters are passed by value, never by pointer, unless the pointed-to type is a standard-library type where a pointer is the idiomatic calling convention.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = newAnalyzer()

Analyzer reports pointer parameters that are not idiomatic standard-library types.

View Source
var Registration = goyze.Registration{
	Name:       "ptrparam",
	Categories: []goyze.Category{"immutability"},
	URL:        "https://docs.gomatic.dev/yze/go/ptrparam",
	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-ptrparam command
Command yze-go-ptrparam runs the ptrparam analyzer as a standalone go/analysis checker (text, -json, and -fix output, and as a `go vet -vettool`).
Command yze-go-ptrparam runs the ptrparam analyzer as a standalone go/analysis checker (text, -json, and -fix 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