Skip to content

Commit 5cae052

Browse files
committed
chore: groups govet files to a package
1 parent 16b04f6 commit 5cae052

File tree

11 files changed

+24
-12
lines changed

11 files changed

+24
-12
lines changed

pkg/golinters/govet.go renamed to pkg/golinters/govet/govet.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package govet
22

33
import (
44
"slices"
@@ -139,11 +139,11 @@ var (
139139
)
140140

141141
var (
142-
govetDebugf = logutils.Debug(logutils.DebugKeyGovet)
143-
isGovetDebug = logutils.HaveDebugTag(logutils.DebugKeyGovet)
142+
debugf = logutils.Debug(logutils.DebugKeyGovet)
143+
isDebug = logutils.HaveDebugTag(logutils.DebugKeyGovet)
144144
)
145145

146-
func NewGovet(settings *config.GovetSettings) *goanalysis.Linter {
146+
func New(settings *config.GovetSettings) *goanalysis.Linter {
147147
var conf map[string]map[string]any
148148
if settings != nil {
149149
conf = settings.Settings
@@ -186,7 +186,7 @@ func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers
186186

187187
// TODO(ldez) re-enable httpresponse once https://github.com/golangci/golangci-lint/issues/4482 is fixed.
188188
if name == httpresponse.Analyzer.Name {
189-
govetDebugf("httpresponse is disabled due to panic. See https://github.com/golang/go/issues/66259")
189+
debugf("httpresponse is disabled due to panic. See https://github.com/golang/go/issues/66259")
190190
return false
191191
}
192192

@@ -214,7 +214,7 @@ func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers
214214
}
215215

216216
func debugAnalyzersListf(analyzers []*analysis.Analyzer, message string) {
217-
if !isGovetDebug {
217+
if !isDebug {
218218
return
219219
}
220220

@@ -225,5 +225,5 @@ func debugAnalyzersListf(analyzers []*analysis.Analyzer, message string) {
225225

226226
sort.Strings(analyzerNames)
227227

228-
govetDebugf("%s (%d): %s", message, len(analyzerNames), analyzerNames)
228+
debugf("%s (%d): %s", message, len(analyzerNames), analyzerNames)
229229
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package govet
2+
3+
import (
4+
"testing"
5+
6+
"github.com/golangci/golangci-lint/test/testshared/integration"
7+
)
8+
9+
func TestFromTestdata(t *testing.T) {
10+
integration.RunTestdata(t)
11+
}

pkg/golinters/govet_test.go renamed to pkg/golinters/govet/govet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package govet
22

33
import (
44
"slices"

test/testdata/govet.go renamed to pkg/golinters/govet/testdata/govet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egovet
2-
//golangcitest:config_path testdata/configs/govet.yml
2+
//golangcitest:config_path testdata/govet.yml
33
package testdata
44

55
import (

test/testdata/govet_fieldalignment.go renamed to pkg/golinters/govet/testdata/govet_fieldalignment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egovet
2-
//golangcitest:config_path testdata/configs/govet_fieldalignment.yml
2+
//golangcitest:config_path testdata/govet_fieldalignment.yml
33
package testdata
44

55
type gvfaGood struct {

test/testdata/govet_ifaceassert.go renamed to pkg/golinters/govet/testdata/govet_ifaceassert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egovet
2-
//golangcitest:config_path testdata/configs/govet_ifaceassert.yml
2+
//golangcitest:config_path testdata/govet_ifaceassert.yml
33
package testdata
44

55
import (

0 commit comments

Comments
 (0)