Lines Matching refs:fn
83 func checkExample(fn *ast.FuncDecl, f *File, report reporter) {
84 fnName := fn.Name.Name
85 if params := fn.Type.Params; len(params.List) != 0 {
88 if results := fn.Type.Results; results != nil && len(results.List) != 0 {
142 func checkTest(fn *ast.FuncDecl, prefix string, report reporter) {
144 if fn.Type.Results != nil && len(fn.Type.Results.List) > 0 ||
145 fn.Type.Params == nil ||
146 len(fn.Type.Params.List) != 1 ||
147 len(fn.Type.Params.List[0].Names) > 1 {
152 if !isTestParam(fn.Type.Params.List[0].Type, prefix[:1]) {
156 if !isTestSuffix(fn.Name.Name[len(prefix):]) {
157 report("%s has malformed name: first letter after '%s' must not be lowercase", fn.Name.Name, prefix)
171 fn, ok := node.(*ast.FuncDecl)
172 if !ok || fn.Recv != nil {
180 case strings.HasPrefix(fn.Name.Name, "Example"):
181 checkExample(fn, f, report)
182 case strings.HasPrefix(fn.Name.Name, "Test"):
183 checkTest(fn, "Test", report)
184 case strings.HasPrefix(fn.Name.Name, "Benchmark"):
185 checkTest(fn, "Benchmark", report)