gomutcheck

package module
v1.1.0 Latest Latest
Warning

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

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

README

gomutcheck

A golangci-lint linter to detect struct field mutations in value receiver methods.

Example

package gomutcheck

type ExampleStruct struct {
    ExampleField string
}

func (s ExampleStruct) MutateField() {
    s.ExampleField = "new value"
}
Result:
example.go:8:2: struct field 'ExampleField' is being mutated in value receiver method

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleStruct

type ExampleStruct struct {
	ExampleField string
}

func (ExampleStruct) MutateField

func (s ExampleStruct) MutateField()

Directories

Path Synopsis
cmd
gomutcheck command
pkg

Jump to

Keyboard shortcuts

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