testutil

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 11 Imported by: 1

README

testutil

godoc.org

Utilities for test of static analysis tools.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(t analysistest.Testing, filter func(format string, args ...interface{}) bool) analysistest.Testing

Filter calls t.Errorf when the filter returns true.

func ModFile

func ModFile(t *testing.T, modfilePath string, fix modfile.VersionFixer) io.Reader

ModFile opens a mod file and fixes versions by the version fixer.

func WithModules

func WithModules(t *testing.T, baseDir string, modfileReader io.Reader) (dir string)

WithModules creates a temp dir which is copied from baseDir and generates vendor directory with go.mod. go.mod can be specified by modfileReader.

Types

type ErrorfFunc

type ErrorfFunc func(format string, args ...interface{})

ErrorfFunc implements analysistest.Testing.

func (ErrorfFunc) Errorf

func (f ErrorfFunc) Errorf(format string, args ...interface{})

Errorf implements analysistest.Testing.

Jump to

Keyboard shortcuts

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