value-object

command module
v0.0.0-...-e3c39ba Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 3 Imported by: 0

README

value-object plugin

[!NOTE] This golangci-lint plugin ensures that setter methods in value objects are private, supporting immutability and data integrity in Go applications.

Getting Started

We use Makefile for build and deploy.

make help # show help message with all commands and targets

Example Usage

Bad Code
package example

type ValueObject struct {
    value int
}

// Public setter method - not recommended
func (v *ValueObject) SetValue(val int) {
    v.value = val
}
Good Code
package example

type ValueObject struct {
    value int
}

// Private setter method - follows best practices
func (v *ValueObject) setValue(val int) {
    v.value = val
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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