lint

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package lint contains a linter for Go source code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteToFile

func WriteToFile(fileName string, content string) error

Types

type ABI_Function

type ABI_Function struct {
	Constant        bool        `json:"constant"`
	Inputs          []ABI_Param `json:"inputs"`
	Name            string      `json:"name"`
	Outputs         []ABI_Param `json:"outputs"`
	Payable         bool        `json:"payable"`
	StateMutability string      `json:"stateMutability"`
	Type            string      `json:"type"`
}

type ABI_Param

type ABI_Param struct {
	Components string `json:"components,omitempty"`
	Name       string `json:"name"`
	Type       string `json:"type"`
}

type Linter

type Linter struct {
}

A Linter lints Go source code.

func (*Linter) Lint

func (l *Linter) Lint(filename string, src []byte) ([]Problem, error)

Lint lints src.

func (*Linter) LintFiles

func (l *Linter) LintFiles(files map[string][]byte) ([]Problem, error)

LintFiles lints a set of files of a single package. The argument is a map of filename to source.

type Problem

type Problem struct {
	Position   token.Position // position in source file
	Text       string         // the prose that describes the problem
	Link       string         // (optional) the link to the style guide for the problem
	Confidence float64        // a value in (0,1] estimating the confidence in this problem's correctness
	LineText   string         // the source line
	Category   string         // a short name for the general category of the problem

	// If the problem has a suggested fix (the minority case),
	// ReplacementLine is a full replacement for the relevant line of the source file.
	ReplacementLine string
}

Problem represents a problem in some source code.

Jump to

Keyboard shortcuts

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