- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for IsNamedType (0.21 sec)
-
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go
id, ok := fun.X.(*ast.Ident) return ok && id.Name == "http" // function in net/http package. } if analysisutil.IsNamedType(typ, "net/http", "Client") { return true // method on http.Client. } ptr, ok := aliases.Unalias(typ).(*types.Pointer) return ok && analysisutil.IsNamedType(ptr.Elem(), "net/http", "Client") // method on *http.Client. } // restOfBlock, given a traversal stack, finds the innermost containing
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 5K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go
if len(x.Args) != 0 { break } sel, ok := x.Fun.(*ast.SelectorExpr) if !ok { break } switch sel.Sel.Name { case "Pointer", "UnsafeAddr": if analysisutil.IsNamedType(info.Types[sel.X].Type, "reflect", "Value") { return true } } } // "(3) Conversion of a Pointer to a uintptr and back, with arithmetic." return isSafeArith(info, x) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 4.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go
if imp.Path() == path { return true } } return false } // IsNamedType reports whether t is the named type with the given package path // and one of the given names. // This function avoids allocating the concatenation of "pkg.Name", // which is important for the performance of syntax matching. func IsNamedType(t types.Type, pkgPath string, names ...string) bool { n, ok := aliases.Unalias(t).(*types.Named)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 03 02:38:00 UTC 2024 - 3.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/timeformat/timeformat.go
if f.Name() != "Format" || f.Pkg() == nil || f.Pkg().Path() != "time" { return false } // Verify that the receiver is time.Time. recv := f.Type().(*types.Signature).Recv() return recv != nil && analysisutil.IsNamedType(recv.Type(), "time", "Time") } func isTimeDotParse(f *types.Func) bool { return analysisutil.IsFunctionNamed(f, "time", "Parse") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 3.3K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/slog/slog.go
} else { pass.ReportRangef(call, "call to %s has a missing or misplaced value", shortName(fn)) } } }) return nil, nil } func isAttr(t types.Type) bool { return analysisutil.IsNamedType(t, "log/slog", "Attr") } // shortName returns a name for the function that is shorter than FullName. // Examples: // // "slog.Info" (instead of "log/slog.Info")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 7.2K bytes - Viewed (0)