Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 1,938 for panics (0.21 sec)

  1. test/chan/select3.go

    const never = "function did"
    
    func unreachable() {
    	panic("control flow shouldn't reach here")
    }
    
    // Calls f and verifies that f always/never panics depending on signal.
    func testPanic(signal string, f func()) {
    	defer func() {
    		s := never
    		if recover() != nil {
    			s = always // f panicked
    		}
    		if s != signal {
    			panic(signal + " panic")
    		}
    	}()
    	f()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 08 02:10:12 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  2. src/cmd/go/testdata/script/test_json_panic_exit.txt

    # 'go test -json' should say a test fails if it exits 1 and prints nothing.
    ! go test -json ./exit1main
    stdout '"Action":"fail".*\n\z'
    ! stdout '"Test":.*\n\z'
    
    # 'go test -json' should say a test fails if it panics.
    ! go test -json ./panic
    stdout '"Action":"fail".*\n\z'
    ! stdout '"Test":.*\n\z'
    
    -- go.mod --
    module example.com/test
    
    go 1.14
    
    -- pass/pass_test.go --
    package pass_test
    
    import "testing"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 19:50:36 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/dumper.go

    // them from genuine panics which we don't want to return as errors.
    type writeError struct {
    	err error
    }
    
    // printf is a convenience wrapper that takes care of print errors.
    func (p *dumper) printf(format string, args ...interface{}) {
    	if _, err := fmt.Fprintf(p, format, args...); err != nil {
    		panic(writeError{err})
    	}
    }
    
    // dump prints the contents of x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 08 17:32:14 UTC 2021
    - 4.5K bytes
    - Viewed (0)
  4. test/fixedbugs/issue11614.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Test that incorrect expressions involving wrong anonymous interface
    // do not generate panics in Type Stringer.
    // Does not compile.
    
    package main
    
    type I interface {
    	int // ERROR "interface contains embedded non-interface|embedding non-interface type int requires"
    }
    
    func n() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 02:26:58 UTC 2022
    - 753 bytes
    - Viewed (0)
  5. src/runtime/debugcall.go

    			ret = debugCallUnsafePoint
    		}
    	})
    	return ret
    }
    
    // debugCallWrap starts a new goroutine to run a debug call and blocks
    // the calling goroutine. On the goroutine, it prepares to recover
    // panics from the debug call, and then calls the call dispatching
    // function at PC dispatch.
    //
    // This must be deeply nosplit because there are untyped values on the
    // stack from debugCallV2.
    //
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 20:50:21 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  6. test/fixedbugs/issue19515.go

    // compile
    
    // Copyright 2017 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Issue 19515: compiler panics on spilling int128 constant.
    
    package x
    
    type VScrollPanel struct {
    	x, y int
    }
    
    type Color struct {
    	R, G, B, A float32
    }
    
    func maxF(a, b float32) float32 {
    	if a > b {
    		return 0
    	}
    	return 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 14 22:55:52 UTC 2017
    - 931 bytes
    - Viewed (0)
  7. pkg/filewatcher/filewatcher.go

    // delivering events to related channel.
    type FileWatcher interface {
    	// Start watching a path. Calling Add multiple times on the same path panics.
    	Add(path string) error
    
    	// Stop watching a path. Removing a path that's not currently being watched panics.
    	Remove(path string) error
    	Close() error
    	Events(path string) chan fsnotify.Event
    	Errors(path string) chan error
    }
    
    type fileWatcher struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  8. src/syscall/syscall.go

    // StringByteSlice converts a string to a NUL-terminated []byte,
    // If s contains a NUL byte this function panics instead of
    // returning an error.
    //
    // Deprecated: Use ByteSliceFromString instead.
    func StringByteSlice(s string) []byte {
    	a, err := ByteSliceFromString(s)
    	if err != nil {
    		panic("syscall: string with NUL passed to StringByteSlice")
    	}
    	return a
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  9. src/testing/run_example.go

    			os.Exit(1)
    		}
    		outC <- buf.String()
    	}()
    
    	finished := false
    	start := time.Now()
    
    	// Clean up in a deferred call so we can recover if the example panics.
    	defer func() {
    		timeSpent := time.Since(start)
    
    		// Close pipe, restore stdout, get output.
    		w.Close()
    		os.Stdout = stdout
    		out := <-outC
    
    		err := recover()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. src/runtime/ehooks_test.go

    			},
    			{
    				mode:     "goodexit",
    				expected: "orange apple",
    			},
    			{
    				mode:     "badexit",
    				expected: "blub blix",
    			},
    			{
    				mode: "panics",
    				musthave: []string{
    					"fatal error: exit hook invoked panic",
    					"main.testPanics",
    				},
    			},
    			{
    				mode: "callsexit",
    				musthave: []string{
    					"fatal error: exit hook invoked exit",
    				},
    			},
    			{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 16:41:13 UTC 2024
    - 2.1K bytes
    - Viewed (0)
Back to top