Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
lesiwPublic archive

About

A line length analyzer for Go.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Note

This repository has moved to lesiw.io/tools/analyzers/linelen.

lesiw.io/linelen

Go Reference CI Release Go Version Discord License

An analysis.Analyzer for line length.

Width is measured in runes after expanding tabs, so a multibyte character counts once and a tab counts as its display width. Carriage returns are stripped before measuring. The defaults — a limit of 79 and a tab width of 4 — are flags.

Checks

Lines over the limit

A line wider than the limit is reported with its measured width. A tab counts four columns by default. A line is not reported when:

  • It is an import declaration.
  • It is a function, method, or interface method signature. A signature stays on one line or wraps as its author chose, while the body is still measured.
  • It is in a generated file.
  • One continuous string literal or URL takes up more than half of the line's width, ignoring indentation.

Usage

go get -tool lesiw.io/linelen/cmd/linelen
go tool linelen ./... # equivalent to: go tool linelen -len 79 -tab 4 ./...

About

A line length analyzer for Go.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages