Search Options

Results per page
Sort
Preferred Languages
Advance

Results 151 - 160 of 1,675 for mypanic (0.19 sec)

  1. test/chan/select.go

    	if v := Send(a, b); v != 2 {
    		println("Send returned", v, "!= 2")
    		panic("fail")
    	}
    	if av, bv := <-a, <-b; av|bv != 3 {
    		println("bad values", av, bv)
    		panic("fail")
    	}
    	if v := Send(a, nil); v != 1 {
    		println("Send returned", v, "!= 1")
    		panic("fail")
    	}
    	if counter != 10 {
    		println("counter is", counter, "!= 10")
    		panic("fail")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:44:02 UTC 2012
    - 913 bytes
    - Viewed (0)
  2. test/fixedbugs/issue5856.go

    package main
    
    import (
    	"fmt"
    	"os"
    	"runtime"
    	"strings"
    )
    
    func main() {
    	f()
    	panic("deferred function not run")
    }
    
    var x = 1
    
    func f() {
    	if x == 0 {
    		return
    	}
    	defer g()
    	panic("panic")
    }
    
    func g() {
    	_, file, line, _ := runtime.Caller(2)
    	if !strings.HasSuffix(file, "issue5856.go") || line != 28 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 28 20:55:36 UTC 2018
    - 586 bytes
    - Viewed (0)
  3. test/fixedbugs/issue8047.go

    package main
    
    func stackit(n int) {
    	if n == 0 {
    		return
    	}
    	stackit(n - 1)
    }
    
    func main() {
    	defer func() {
    		// catch & ignore panic from nil defer below
    		err := recover()
    		if err == nil {
    			panic("defer of nil func didn't panic")
    		}
    	}()
    	defer ((func())(nil))()
    	stackit(1000)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 530 bytes
    - Viewed (0)
  4. src/cmd/go/testdata/script/bug.txt

    )
    
    func main() {
    	u, err := url.Parse(os.Args[1])
    	if err != nil {
    		panic(err)
    	}
    	body, err := url.PathUnescape(u.Query().Get("body"))
    	if err != nil {
    		panic(err)
    	}
    	out := filepath.Join(os.TempDir(), "browser")
    	f, err := os.Create(out)
    	if err != nil {
    		panic(err)
    	}
    	fmt.Fprintln(f, body)
    	if err := f.Close(); err != nil {
    		panic(err)
    	}
    }
    
    -- go/main.go --
    package main
    
    import (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 21:26:10 UTC 2022
    - 963 bytes
    - Viewed (0)
  5. test/fixedbugs/issue59411.go

    	i := 0
    	for range m {
    		if i == 6 {
    			// Partway through iteration, clear the map.
    			clear(m)
    		} else if i > 6 {
    			// If we advance to the next iteration, that's a bug.
    			panic("BAD")
    		}
    		i++
    	}
    	if len(m) != 0 {
    		panic("clear did not empty the map")
    	}
    }
    
    func g() {
    	// Allocate map.
    	m := map[float64]int{}
    	// Fill to just before a growth trigger.
    	const N = 13 << 4 // 6.5 * 2 * 2^k
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Apr 08 05:25:04 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  6. pkg/util/iptables/monitor_test.go

    	panic("should not be reached")
    }
    
    func (mfc *monitorFakeCmd) SetStdout(out io.Writer) {
    	panic("should not be reached")
    }
    
    func (mfc *monitorFakeCmd) SetStderr(out io.Writer) {
    	panic("should not be reached")
    }
    
    func (mfc *monitorFakeCmd) SetEnv(env []string) {
    	panic("should not be reached")
    }
    
    func (mfc *monitorFakeCmd) StdoutPipe() (io.ReadCloser, error) {
    	panic("should not be reached")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 08 15:21:59 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  7. test/method3.go

    	Len() int
    }
    
    func main() {
    	var t T = T{0, 1, 2, 3, 4}
    	var i I
    	i = t
    	if i.Len() != 5 {
    		println("i.Len", i.Len())
    		panic("fail")
    	}
    	if T.Len(t) != 5 {
    		println("T.Len", T.Len(t))
    		panic("fail")
    	}
    	if (*T).Len(&t) != 5 {
    		println("(*T).Len", (*T).Len(&t))
    		panic("fail")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 07:47:26 UTC 2012
    - 570 bytes
    - Viewed (0)
  8. test/func8.go

    	xy += "x"
    	return false
    }
    
    //go:noinline
    func y() string {
    	xy += "y"
    	return "abc"
    }
    
    func main() {
    	if f() == g() {
    		panic("wrong f,g order")
    	}
    
    	if x() == (y() == "abc") {
    		panic("wrong compare")
    	}
    	if xy != "xy" {
    		panic("wrong x,y order")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 599 bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/field.go

    		return fmt.Sprintf("[%d, len=0]", b.Offs)
    	}
    }
    
    // Parse extracts the bitfield b from i, and return it as an unsigned integer.
    // Parse will panic if b is invalid.
    func (b BitField) Parse(i [2]uint32) uint32 {
    	if b.Bits > 32 || b.Bits == 0 || b.Offs > 31 || b.Offs+b.Bits > 32 {
    		panic(fmt.Sprintf("invalid bitfiled %v", b))
    	}
    	return (i[b.Word] >> (32 - b.Offs - b.Bits)) & ((1 << b.Bits) - 1)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 10 18:59:52 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  10. src/syscall/js/js.go

    	if !ok {
    		if vType := v.Type(); !vType.isObject() { // check here to avoid overhead in success case
    			panic(&ValueError{"Value.Call", vType})
    		}
    		if propType := v.Get(m).Type(); propType != TypeFunction {
    			panic("syscall/js: Value.Call: property " + m + " is not a function, got " + propType.String())
    		}
    		panic(Error{makeValue(res)})
    	}
    	return makeValue(res)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 14:35:26 UTC 2024
    - 19.5K bytes
    - Viewed (0)
Back to top