linters: add httpstatus linter
This commit is contained in:
22
pkg/httpstatus/analyzer_test.go
Normal file
22
pkg/httpstatus/analyzer_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package httpstatus_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/tools/go/analysis/analysistest"
|
||||
|
||||
"git.offline-twitter.com/offline-labs/go-lint/pkg/httpstatus"
|
||||
)
|
||||
|
||||
func TestAnalyzer(t *testing.T) {
|
||||
analysistest.Run(t, analysistest.TestData(), httpstatus.Analyzer, "default")
|
||||
}
|
||||
|
||||
func TestAnalyzerWithSettings(t *testing.T) {
|
||||
analyzer := httpstatus.NewAnalyzer(httpstatus.Settings{
|
||||
TypicalStatusCodes: []int{201},
|
||||
IsRestricted: true,
|
||||
})
|
||||
|
||||
analysistest.Run(t, analysistest.TestData(), analyzer, "configured")
|
||||
}
|
||||
Reference in New Issue
Block a user