Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 738 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 738 Bytes

gocritic

gocritic is a Go library for CriticMarkup.

Note: This project is a library only, if you are looking for a CLI tool, go to gocritic-cli.

Use

The main function is gocritic.Critic, here is its full signature:

func gocritic.Critic(w io.Writer, r io.Reader, fopts ...func(*Options)) (int, error)

The fopts argument is used to specify options

A typical use is:

if _, err := gocritic.Critic(out, int); err != nil {
  // handle the error
}

To generate only the original sources:

if _, err := gocritic.Critic(out, int, gocritic.FilterOnlyOriginal); err != nil {
  // handle the error
}