func Skip(s lint.Skipper, then func(error) error) func(err error) error {
	return func(err error) error {
		return then(lint.Skip(err, s))
	}
}
Skip returns a function that skips errors using s and verifies the result using then
package testutil
import (
	"fmt"
	"strconv"
	"path/filepath"
	"strings"
	"regexp"
	"reflect"
	"github.com/sridharv/fakegopath"
	"github.com/surullabs/lint"
	"github.com/surullabs/lint/checkers"
)
type StaticCheckMultiFileTest struct {
	Contents [][]byte
	Checker lint.Checker
	Validate func(err error) error
}
func (s StaticCheckMultiFileTest) Test(pkg string) error {
	checkers.Unload(pkg)
	files := make([]fakegopath.SourceFile, 0, len(s.Contents))
	for i, content := range s.Contents {
		files = append(files, fakegopath.SourceFile{
			Src:     "",
			Content: content,
			Dest:    filepath.Join(pkg, "file"+strconv.Itoa(i)+".go"),
		})
	}
	tmp, err := fakegopath.NewTemporaryWithFiles(pkg, files)
	if err != nil {
		return fmt.Errorf("failed to create temporary go path: %v", err)
	}
	defer tmp.Reset()
	return s.Validate(s.Checker.Check(pkg))
}
type StaticCheckTest struct {
	File string
	Content []byte
	Checker lint.Checker
	Validate func(err error) error
}
func (s StaticCheckTest) Test(pkg string) error {
	checkers.Unload(pkg)
	tmp, err := fakegopath.NewTemporaryWithFiles(pkg, []fakegopath.SourceFile{
		{Src: s.File, Content: s.Content, Dest: filepath.Join(pkg, "file.go")},
	})
	if err != nil {
		return fmt.Errorf("failed to create temporary go path: %v", err)
	}
	defer tmp.Reset()
	return s.Validate(s.Checker.Check(pkg))
}
type Errorer interface {
	Error(args ...interface{})
}
func Test(t Errorer, pkg string, tests []StaticCheckTest) {
	for i, test := range tests {
		if err := test.Test(pkg); err != nil {
			t.Error("Check", i, err)
		}
	}
}
func SkippedErrors(pattern string) func(error) error {
	return Skip(lint.RegexpMatch(pattern), NoError)
}