gomoddirectives

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 14

README

gomoddirectives

Sponsor Build Status

A linter that handle replace, retract, exclude directives into go.mod.

Features:

Documentation

Overview

Package gomoddirectives a linter that handle `replace`, `retract`, `exclude` directives into `go.mod`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModuleFile

func GetModuleFile() (*modfile.File, error)

GetModuleFile gets module file.

Types

type Options

type Options struct {
	ReplaceAllowList          []string
	ReplaceAllowLocal         bool
	ExcludeForbidden          bool
	RetractAllowNoExplanation bool
}

Options the analyzer options.

type Result

type Result struct {
	Reason string
	Start  token.Position
	End    token.Position
}

Result the analysis result.

func Analyze

func Analyze(opts Options) ([]Result, error)

Analyze analyzes a project.

func AnalyzeFile added in v0.2.0

func AnalyzeFile(file *modfile.File, opts Options) []Result

AnalyzeFile analyzes a mod file.

func NewResult

func NewResult(file *modfile.File, line *modfile.Line, reason string) Result

NewResult creates a new Result.

func (Result) String

func (r Result) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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