Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,859 for reportf (0.18 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag.go

    			check.pass.Reportf(pos, "malformed //go:build line (space between // and go:build)")
    		}
    		return
    	}
    	if !check.goBuildOK || check.inStar {
    		check.pass.Reportf(pos, "misplaced //go:build comment")
    		check.crossCheck = false
    		return
    	}
    
    	if check.goBuildPos == token.NoPos {
    		check.goBuildPos = pos
    	} else {
    		check.pass.Reportf(pos, "unexpected extra //go:build line")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go

    			check.pass.Reportf(pos, "//go:debug directive only valid in Go source files")
    		} else if check.file.Name.Name != "main" && !strings.HasSuffix(check.filename, "_test.go") {
    			check.pass.Reportf(pos, "//go:debug directive only valid in package main or test")
    		} else if !check.inHeader {
    			check.pass.Reportf(pos, "//go:debug directive only valid before package declaration")
    		}
    	}
    }
    
    // Go 1.20 strings.CutPrefix.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/framepointer/framepointer.go

    // Package framepointer defines an Analyzer that reports assembly code
    // that clobbers the frame pointer before saving it.
    package framepointer
    
    import (
    	"go/build"
    	"regexp"
    	"strings"
    
    	"golang.org/x/tools/go/analysis"
    	"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
    )
    
    const Doc = "report assembly that clobbers the frame pointer before saving it"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go

    		switch t.Underlying().(type) {
    		case *types.Pointer, *types.Interface, *types.TypeParam:
    			return
    		}
    
    		switch argidx {
    		case 0:
    			pass.Reportf(call.Lparen, "call of %s passes non-pointer", fn.Name())
    		case 1:
    			pass.Reportf(call.Lparen, "call of %s passes non-pointer as second argument", fn.Name())
    		}
    	})
    	return nil, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/defers/defers.go

    	}
    
    	checkDeferCall := func(node ast.Node) bool {
    		switch v := node.(type) {
    		case *ast.CallExpr:
    			if analysisutil.IsFunctionNamed(typeutil.StaticCallee(pass.TypesInfo, v), "time", "Since") {
    				pass.Reportf(v.Pos(), "call to time.Since is not deferred")
    			}
    		case *ast.FuncLit:
    			return false // prune
    		}
    		return true
    	}
    
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag_old.go

    		}
    
    		// Check each line of a //-comment.
    		for _, c := range group.List {
    			if !strings.Contains(c.Text, "+build") {
    				continue
    			}
    			if err := checkLine(c.Text, pastCutoff); err != nil {
    				pass.Reportf(c.Pos(), "%s", err)
    			}
    		}
    	}
    }
    
    func checkOtherFile(pass *analysis.Pass, filename string) error {
    	content, tf, err := analysisutil.ReadFile(pass, filename)
    	if err != nil {
    		return err
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unusedresult/unusedresult.go

    			if types.Identical(sig, sigNoArgsStringResult) {
    				if stringMethods[fn.Name()] {
    					pass.Reportf(call.Lparen, "result of (%s).%s call not used",
    						sig.Recv().Type(), fn.Name())
    				}
    			}
    		} else {
    			// package-level function (e.g. fmt.Errorf)
    			if pkgFuncs[[2]string{fn.Pkg().Path(), fn.Name()}] {
    				pass.Reportf(call.Lparen, "result of %s.%s call not used",
    					fn.Pkg().Path(), fn.Name())
    			}
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go

    		return
    	}
    
    	for _, key := range checkTagDups {
    		checkTagDuplicates(pass, tag, key, field, field, seen, 1)
    	}
    
    	if err := validateStructTag(tag); err != nil {
    		pass.Reportf(field.Pos(), "struct field tag %#q not compatible with reflect.StructTag.Get: %s", tag, err)
    	}
    
    	// Check for use of json or xml tags with unexported fields.
    
    	// Embedded struct. Nothing to do for now, but that
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go

    type ObjectFact struct {
    	Object types.Object
    	Fact   Fact
    }
    
    // Reportf is a helper function that reports a Diagnostic using the
    // specified position and formatted error message.
    func (pass *Pass) Reportf(pos token.Pos, format string, args ...interface{}) {
    	msg := fmt.Sprintf(format, args...)
    	pass.Report(Diagnostic{Pos: pos, Message: msg})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/timeformat/timeformat.go

    							TextEdits: []analysis.TextEdit{{
    								Pos:     token.Pos(pos),
    								End:     token.Pos(end),
    								NewText: []byte(goodFormat),
    							}},
    						}},
    					})
    				} else {
    					pass.Reportf(arg.Pos(), badFormat+" should be "+goodFormat)
    				}
    			}
    		}
    	})
    	return nil, nil
    }
    
    func isTimeDotFormat(f *types.Func) bool {
    	if f.Name() != "Format" || f.Pkg() == nil || f.Pkg().Path() != "time" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.3K bytes
    - Viewed (0)
Back to top