Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 3,240 for reportf (0.26 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/ifaceassert.go

    			}
    		}
    		V := pass.TypesInfo.TypeOf(assert.X)
    		for _, target := range targets {
    			T := pass.TypesInfo.TypeOf(target)
    			if f := assertableTo(&free, V, T); f != nil {
    				pass.Reportf(
    					target.Pos(),
    					"impossible type assertion: no type can implement both %v and %v (conflicting types for %v method)",
    					V, T, f.Name(),
    				)
    			}
    		}
    	})
    	return nil, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go

    without adding a dependency to the core API, so an analysis tool pays
    only for the extensions it needs.
    
    The Report function emits a diagnostic, a message associated with a
    source position. For most analyses, diagnostics are their primary
    result.
    For convenience, Pass provides a helper method, Reportf, to report a new
    diagnostic by formatting a string.
    Diagnostic is defined as:
    
    	type Diagnostic struct {
    		Pos      token.Pos
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go

    	format, idx := formatString(pass, call)
    	if idx < 0 {
    		if false {
    			pass.Reportf(call.Lparen, "can't check non-constant format in call to %s", fn.FullName())
    		}
    		return
    	}
    
    	firstArg := idx + 1 // Arguments are immediately after format string.
    	if !strings.Contains(format, "%") {
    		if len(call.Args) > firstArg {
    			pass.Reportf(call.Lparen, "%s call has arguments but no formatting directives", fn.FullName())
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 32.5K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

    // Package asmdecl defines an Analyzer that reports mismatches between
    // assembly files and Go declarations.
    package asmdecl
    
    import (
    	"bytes"
    	"fmt"
    	"go/ast"
    	"go/build"
    	"go/token"
    	"go/types"
    	"log"
    	"regexp"
    	"strconv"
    	"strings"
    
    	"golang.org/x/tools/go/analysis"
    	"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
    )
    
    const Doc = "report mismatches between assembly files and Go declarations"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    			return
    		}
    		typ = obj.Type()
    	} else {
    		typ = pass.TypesInfo.Types[e].Type
    	}
    
    	if typ == nil {
    		return
    	}
    	if path := lockPath(pass.Pkg, typ, nil); path != nil {
    		pass.Reportf(e.Pos(), "range var %s copies lock: %v", analysisutil.Format(pass.Fset, e), path)
    	}
    }
    
    type typePath []string
    
    // String pretty-prints a typePath.
    func (path typePath) String() string {
    	n := len(path)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/telemetry/internal/upload/reports.go

    	}
    	// 1. generate the local report
    	localContents, err := json.MarshalIndent(report, "", " ")
    	if err != nil {
    		return "", fmt.Errorf("failed to marshal report for %s: %v", expiryDate, err)
    	}
    	// check that the report can be read back
    	// TODO(pjw): remove for production?
    	var report2 telemetry.Report
    	if err := json.Unmarshal(localContents, &report2); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 14:52:56 UTC 2024
    - 10.3K bytes
    - Viewed (0)
Back to top