github.com/songshiyun/revive@v1.1.5-0.20220323112655-f8433a19b3c5/test/context-as-argument_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/songshiyun/revive/lint"
     7  	"github.com/songshiyun/revive/rule"
     8  )
     9  
    10  func TestContextAsArgument(t *testing.T) {
    11  	testRule(t, "context-as-argument", &rule.ContextAsArgumentRule{}, &lint.RuleConfig{
    12  		Arguments: []interface{}{
    13  			map[string]interface{}{
    14  				"allowTypesBefore": "AllowedBeforeType,AllowedBeforeStruct,*AllowedBeforePtrStruct,*testing.T",
    15  			},
    16  		},
    17  	},
    18  	)
    19  }