"Fossies" - the Fresh Open Source Software Archive

Member "go/src/runtime/testdata/testprog/abort.go" (9 Sep 2020, 449 Bytes) of package /windows/misc/go1.14.9.windows-386.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Go source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Copyright 2018 The Go Authors. All rights reserved.
    2 // Use of this source code is governed by a BSD-style
    3 // license that can be found in the LICENSE file.
    4 
    5 package main
    6 
    7 import _ "unsafe" // for go:linkname
    8 
    9 func init() {
   10     register("Abort", Abort)
   11 }
   12 
   13 //go:linkname runtimeAbort runtime.abort
   14 func runtimeAbort()
   15 
   16 func Abort() {
   17     defer func() {
   18         recover()
   19         panic("BAD: recovered from abort")
   20     }()
   21     runtimeAbort()
   22     println("BAD: after abort")
   23 }