mirror of
https://github.com/mgechev/revive.git
synced 2025-02-15 13:53:15 +02:00
parent
fb3c2d09af
commit
1b2ffe282e
@ -12,14 +12,20 @@ func Exported() hidden { // MATCH /exported func Exported returns unexported typ
|
|||||||
|
|
||||||
// ExpErr returns a builtin type.
|
// ExpErr returns a builtin type.
|
||||||
func ExpErr() error { // ok
|
func ExpErr() error { // ok
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hidden) ExpOnHidden() hidden { // ok
|
func (h hidden) ExpOnHidden() hidden { // ok
|
||||||
|
return h
|
||||||
|
}
|
||||||
|
|
||||||
|
func (hidden) ForInterface() error {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface is exported.
|
// Interface is exported.
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
ExpOnHidden()
|
ForInterface() error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExportedAsInterface returns a hidden type as an exported interface, which is fine.
|
// ExportedAsInterface returns a hidden type as an exported interface, which is fine.
|
||||||
|
@ -7,9 +7,8 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mgechev/revive/rule"
|
|
||||||
|
|
||||||
"github.com/mgechev/revive/lint"
|
"github.com/mgechev/revive/lint"
|
||||||
|
"github.com/mgechev/revive/rule"
|
||||||
)
|
)
|
||||||
|
|
||||||
var lintMatch = flag.String("lint.match", "", "restrict fixtures matches to this pattern")
|
var lintMatch = flag.String("lint.match", "", "restrict fixtures matches to this pattern")
|
||||||
@ -55,16 +54,15 @@ func TestAll(t *testing.T) {
|
|||||||
if !rx.MatchString(fi.Name()) {
|
if !rx.MatchString(fi.Name()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
//t.Logf("Testing %s", fi.Name())
|
t.Run(fi.Name(), func(t *testing.T) {
|
||||||
src, err := ioutil.ReadFile(path.Join(baseDir, fi.Name()))
|
src, err := ioutil.ReadFile(path.Join(baseDir, fi.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed reading %s: %v", fi.Name(), err)
|
t.Fatalf("Failed reading %s: %v", fi.Name(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = assertFailures(t, baseDir, fi, src, rules, map[string]lint.RuleConfig{})
|
if err := assertFailures(t, baseDir, fi, src, rules, map[string]lint.RuleConfig{}); err != nil {
|
||||||
if err != nil {
|
t.Errorf("Linting %s: %v", fi.Name(), err)
|
||||||
t.Errorf("Linting %s: %v", fi.Name(), err)
|
}
|
||||||
continue
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user