- Sort Score
- Result 10 results
- Languages All
Results 81 - 90 of 1,938 for panics (4.1 sec)
-
test/typeparam/settable.go
if len(s) != 1 || s[0] != 1 { panic(fmt.Sprintf("got %v, want %v", s, []int{1})) } defer func() { if recover() == nil { panic("did not panic as expected") } }() // This should type check but should panic at run time, // because it will make a slice of *SettableInt and then call // Set on a nil value. fromStrings3[*SettableInt]([]string{"1"})
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 23:48:58 UTC 2022 - 2.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/extractdoc.go
// license that can be found in the LICENSE file. package analysisinternal import ( "fmt" "go/parser" "go/token" "strings" ) // MustExtractDoc is like [ExtractDoc] but it panics on error. // // To use, define a doc.go file such as: // // // Package halting defines an analyzer of program termination. // // // // # Analyzer halting // // // // halting: reports whether execution will halt.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 3.4K bytes - Viewed (0) -
src/internal/trace/resources.go
// // r.Kind must be ResourceGoroutine or this function will panic. func (r ResourceID) Goroutine() GoID { if r.Kind != ResourceGoroutine { panic(fmt.Sprintf("attempted to get GoID from %s resource ID", r.Kind)) } return GoID(r.id) } // Proc obtains a ProcID from the resource ID. // // r.Kind must be ResourceProc or this function will panic. func (r ResourceID) Proc() ProcID { if r.Kind != ResourceProc {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 8K bytes - Viewed (0) -
pkg/test/util/tmpl/evaluate.go
} return s } // MustEvaluate calls Evaluate and panics if there is an error. func MustEvaluate(tpl string, data any) string { s, err := Evaluate(tpl, data) if err != nil { panic(fmt.Sprintf("tmpl.MustEvaluate: %v", err)) } return s } func MustEvaluateFile(filePath string, data any) string { s, err := EvaluateFile(filePath, data) if err != nil { panic(fmt.Sprintf("tmpl.MustEvaluate: %v", err)) } return s
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 3.1K bytes - Viewed (0) -
test/fixedbugs/issue4085b.go
} } func shouldPanic(str string, f func()) { defer func() { err := recover() if err == nil { panic("did not panic") } s := err.(error).Error() if !strings.Contains(s, str) { panic("got panic " + s + ", want " + str) } }() f() } // Test make in append panics since the gc compiler optimizes makes in appends. func testMakeInAppend(n int) { lengths := []int{0, 1}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 17 17:18:17 UTC 2019 - 2.9K bytes - Viewed (0) -
staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go
return &ApiextensionsV1beta1Client{client}, nil } // NewForConfigOrDie creates a new ApiextensionsV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *ApiextensionsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new ApiextensionsV1beta1Client for the given RESTClient.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Oct 20 04:39:39 UTC 2021 - 3.2K bytes - Viewed (0) -
src/net/http/httptest/httptest.go
// // The provided body may be nil. If the body is of type *bytes.Reader, // *strings.Reader, or *bytes.Buffer, the Request.ContentLength is // set. // // NewRequest panics on error for ease of use in testing, where a // panic is acceptable. // // To generate a client HTTP request instead of a server request, see // the NewRequest function in the net/http package.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 11 18:09:14 UTC 2024 - 2.6K bytes - Viewed (0) -
src/math/big/sqrt.go
// result of z.Acc() is undefined. // // The function panics if z < 0. The value of z is undefined in that // case. func (z *Float) Sqrt(x *Float) *Float { if debugFloat { x.validate() } if z.prec == 0 { z.prec = x.prec } if x.Sign() == -1 { // following IEEE754-2008 (section 7.2) panic(ErrNaN{"square root of negative operand"}) } // handle ±0 and +∞
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 11 16:34:30 UTC 2022 - 2.8K bytes - Viewed (0) -
src/cmd/compile/internal/ir/mini.go
func (n *miniNode) Type() *types.Type { return nil } func (n *miniNode) SetType(*types.Type) { panic(n.no("SetType")) } func (n *miniNode) Name() *Name { return nil } func (n *miniNode) Sym() *types.Sym { return nil } func (n *miniNode) Val() constant.Value { panic(n.no("Val")) } func (n *miniNode) SetVal(v constant.Value) { panic(n.no("SetVal")) } func (n *miniNode) NonNil() bool { return false }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 31 22:09:44 UTC 2022 - 2.8K bytes - Viewed (0) -
src/crypto/rand/util.go
p.SetBytes(bytes) if p.ProbablyPrime(20) { return p, nil } } } // Int returns a uniform random value in [0, max). It panics if max <= 0. func Int(rand io.Reader, max *big.Int) (n *big.Int, err error) { if max.Sign() <= 0 { panic("crypto/rand: argument to Int is <= 0") } n = new(big.Int) n.Sub(max, n.SetUint64(1)) // bitLen is the maximum bit length needed to encode a value < max.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 2.4K bytes - Viewed (0)