stylecheck

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stylecheck enforces the Lesstruct Go file-layout contract: methods stay with the struct that owns them, constructors close their type, and package-level helpers precede public declarations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker holds the parser state shared by one run.

func NewChecker

func NewChecker() *Checker

NewChecker returns a checker with a fresh file set.

func (*Checker) CheckDir

func (c *Checker) CheckDir(root string) ([]Finding, error)

CheckDir checks every non-test, non-generated .go file under root.

func (*Checker) CheckFile

func (c *Checker) CheckFile(path string) ([]Finding, error)

CheckFile checks one .go file.

func (*Checker) CheckSource

func (c *Checker) CheckSource(path string, src []byte) ([]Finding, error)

CheckSource parses and checks one source blob named path.

type Finding

type Finding struct {
	Pos     token.Position
	Message string
}

Finding is one layout violation.

func (Finding) String

func (f Finding) String() string

String renders the finding as `file:line:col: message`.

Directories

Path Synopsis
cmd
stylecheck command
Command stylecheck enforces the Lesstruct Go file-layout contract.
Command stylecheck enforces the Lesstruct Go file-layout contract.

Jump to

Keyboard shortcuts

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