Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 892 for panics (0.27 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    // If the current Node is not part of a slice, Delete panics.
    // As a special case, if the current node is a package file,
    // Delete removes it from the package's Files map.
    func (c *Cursor) Delete() {
    	if _, ok := c.node.(*ast.File); ok {
    		delete(c.parent.(*ast.Package).Files, c.name)
    		return
    	}
    
    	i := c.Index()
    	if i < 0 {
    		panic("Delete node not contained in slice")
    	}
    	v := c.field()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  2. pkg/config/schema/gvk/resources.gen.go

    	}
    
    	return schema.GroupVersionResource{}, false
    }
    
    // MustToGVR converts a GVK to a GVR, and panics if it cannot be converted
    // Warning: this is only safe for known types; do not call on arbitrary GVKs
    func MustToGVR(g config.GroupVersionKind) schema.GroupVersionResource {
    	r, ok := ToGVR(g)
    	if !ok {
    		panic("unknown kind: " + g.String())
    	}
    	return r
    }
    
    // FromGVR converts a GVR to a GVK.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 12 17:37:32 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/cel/common/equality_test.go

    // Creates a *spec.Schema Schema by decoding the given YAML. Panics on error
    func mustSchema(source string) *openapi.Schema {
    	d := yaml.NewYAMLOrJSONDecoder(strings.NewReader(source), 4096)
    	res := &spec.Schema{}
    	if err := d.Decode(res); err != nil {
    		panic(err)
    	}
    	return &openapi.Schema{Schema: res}
    }
    
    // Creates an *unstructured by decoding the given YAML. Panics on error
    func mustUnstructured(source string) interface{} {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 13 21:36:46 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  4. src/cmd/distpack/pack.go

    		log.Fatal(err)
    	}
    	reportHash(name)
    }
    
    // check panics if err is not nil. Otherwise it returns x.
    // It is only meant to be used in a function that has deferred
    // a function to recover appropriately from the panic.
    func check[T any](x T, err error) T {
    	check1(err)
    	return x
    }
    
    // check1 panics if err is not nil.
    // It is only meant to be used in a function that has deferred
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  5. src/slices/slices_test.go

    		{"with out-of-bounds index and = cap", a[:1:2], 2, b[:]},
    		{"with out-of-bounds index and < cap", a[:1:3], 2, b[:]},
    	} {
    		if !panics(func() { _ = Insert(test.s, test.i, test.v...) }) {
    			t.Errorf("Insert %s: got no panic, want panic", test.name)
    		}
    	}
    }
    
    var deleteTests = []struct {
    	s    []int
    	i, j int
    	want []int
    }{
    	{
    		[]int{1, 2, 3},
    		0,
    		0,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/util/version/version.go

    func ParseGeneric(str string) (*Version, error) {
    	return parse(str, false)
    }
    
    // MustParseGeneric is like ParseGeneric except that it panics on error
    func MustParseGeneric(str string) *Version {
    	v, err := ParseGeneric(str)
    	if err != nil {
    		panic(err)
    	}
    	return v
    }
    
    // ParseSemantic parses a version string that exactly obeys the syntax and semantics of
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 18 19:25:29 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  7. src/testing/sub_test.go

    			t.Log("message2")
    			ch <- true
    			<-ch
    			t.Errorf("error")
    		},
    	}, {
    		// If a subtest panics we should run cleanups.
    		desc:   "cleanup when subtest panics",
    		ok:     false,
    		chatty: false,
    		output: `
    --- FAIL: cleanup when subtest panics (N.NNs)
        --- FAIL: cleanup when subtest panics/sub (N.NNs)
        sub_test.go:NNN: running cleanup`,
    		f: func(t *T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 01 21:27:08 UTC 2023
    - 23.8K bytes
    - Viewed (0)
  8. src/debug/gosym/pclntab.go

    func (f funcData) cuOffset() uint32    { return f.field(8) }
    
    // field returns the nth field of the _func struct.
    // It panics if n == 0 or n > 9; for n == 0, call f.entryPC.
    // Most callers should use a named field accessor (just above).
    func (f funcData) field(n uint32) uint32 {
    	if n == 0 || n > 9 {
    		panic("bad funcdata field")
    	}
    	// In Go 1.18, the first field of _func changed
    	// from a uintptr entry PC to a uint32 entry offset.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 25 19:43:24 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  9. src/html/template/template.go

    }
    
    // Must is a helper that wraps a call to a function returning ([*Template], error)
    // and panics if the error is non-nil. It is intended for use in variable initializations
    // such as
    //
    //	var t = template.Must(template.New("name").Parse("html"))
    func Must(t *Template, err error) *Template {
    	if err != nil {
    		panic(err)
    	}
    	return t
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 21:00:46 UTC 2024
    - 17K bytes
    - Viewed (0)
  10. cmd/metrics-v3-types.go

    // descriptors, this function panics.
    //
    // Panics if `labels` is not a list of ordered label name and label value pairs
    // or if all labels for the metric are not provided.
    func (m *MetricValues) Set(name MetricName, value float64, labels ...string) {
    	desc, ok := m.descriptors[name]
    	if !ok {
    		panic(fmt.Sprintf("metric has no description: %s", name))
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 23 07:41:18 UTC 2024
    - 15.1K bytes
    - Viewed (0)
Back to top