-
Notifications
You must be signed in to change notification settings - Fork 9k
/
package.go
28 lines (22 loc) · 893 Bytes
/
package.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package keyvaluetags
import (
"go/ast"
"go/types"
"github.com/bflad/tfproviderlint/helper/astutils"
)
const (
PackageName = `keyvaluetags`
PackagePath = `github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags`
)
// IsFunc returns if the function call is in the package
func IsFunc(e ast.Expr, info *types.Info, funcName string) bool {
return astutils.IsPackageFunc(e, info, PackagePath, funcName)
}
// IsNamedType returns if the type name matches and is from the package
func IsNamedType(t *types.Named, typeName string) bool {
return astutils.IsPackageNamedType(t, PackagePath, typeName)
}
// IsReceiverMethod returns if the receiver method call is in the package
func IsReceiverMethod(e ast.Expr, info *types.Info, receiverName string, methodName string) bool {
return astutils.IsPackageReceiverMethod(e, info, PackagePath, receiverName, methodName)
}