本文整理汇总了Golang中runtime.Breakpoint函数的典型用法代码示例。如果您正苦于以下问题:Golang Breakpoint函数的具体用法?Golang Breakpoint怎么用?Golang Breakpoint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Breakpoint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestConvertToTheNumber10
func TestConvertToTheNumber10(t *testing.T) {
runtime.Breakpoint()
i := convertToTheNumber10(5)
if i != 10 {
t.Fatalf("Expected %d to equal 10", i)
}
}
示例2: warnIfNotClosed
func (e *Entry) warnIfNotClosed() {
if e.e != nil {
log.Printf("precache: Entry(%p) leaked! (Getter: %v)", e, e.e.g)
runtime.Breakpoint()
e.Close()
}
}
示例3: main
func main() {
i1 := 1
i2 := 2
p1 := &i1
runtime.Breakpoint()
fmt.Printf("%d %d %v\n", i1, i2, p1)
}
示例4:
func ext۰runtime۰Breakpoint(fr *Frame, args []Value) Value {
// If tracehook is DefaultTraceHook, should we run a PrintStack
// and leave?
TraceHook(fr, &fr.block.Instrs[0], ssa2.TRACE_CALL)
runtime.Breakpoint()
return nil
}
示例5: main
func main() {
i1 := 1
i2 := 2
p1 := &i1
runtime.Breakpoint()
fmt.Println(i1, i2, p1)
}
示例6: test
func test() {
fmt.Print("aaa")
runtime.Breakpoint()
fmt.Print("bbb")
fmt.Print("bb")
fmt.Print("bb2")
fmt.Print("bbb")
}
示例7: main
func main() {
var i *int
fmt.Println(4 * *2)
fmt.Println(i)
changeSample(&i)
runtime.Breakpoint()
fmt.Println(*i)
}
示例8: main
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
runtime.Breakpoint()
msg := "hello, world!"
header := w.Header().Get("Content-Type")
w.Write([]byte(msg + header))
})
http.ListenAndServe(":9191", nil)
}
示例9: main
func main() {
fn1 := afunction
var o someStruct
fn2 := o.structfunc
fn3 := func(s string) {
fmt.Println("inline", s)
}
runtime.Breakpoint()
fmt.Println(fn1, fn2, fn3, o)
}
示例10: main
func main() {
b := B{A: A{-314}, C: &C{"hello"}, a: A{42}, ptr: &A{1337}}
runtime.Breakpoint()
fmt.Println(b)
fmt.Println(b.val)
fmt.Println(b.A.val)
fmt.Println(b.a.val)
fmt.Println(b.ptr.val)
fmt.Println(b.C.s)
fmt.Println(b.s)
}
示例11: main
func main() {
flag.Parse()
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal(err)
}
runtime.Breakpoint()
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
Print("aaaaaaaaaaaaaaaaaaa")
}
示例12: gcd
// GCD. We assume positive numbers
func gcd(a int, b int) int {
// Make: a <= b
if a > b {
a, b = b, a
}
if a <= 0 {
return -1
}
runtime.Breakpoint()
if a == 1 || b-a == 0 {
return a
}
return gcd(b-a, a)
}
示例13: main
func main() {
n :=
append +
bool +
byte +
complex +
complex64 +
complex128 +
cap +
close +
delete +
error +
false +
float32 +
float64 +
imag +
int +
int8 +
int16 +
int32 +
int64 +
len +
make +
new +
nil +
panic +
print +
println +
real +
recover +
rune +
string +
true +
uint +
uint8 +
uint16 +
uint32 +
uint64 +
uintptr +
iota
if n != NUM*(NUM-1)/2 {
fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2)
runtime.Breakpoint() // panic is inaccessible
}
}
示例14: foobar
func foobar(baz string, bar FooBar) {
var (
a1 = "foofoofoofoofoofoo"
a2 = 6
a3 = 7.23
a4 = [2]int{1, 2}
a5 = []int{1, 2, 3, 4, 5}
a6 = FooBar{Baz: 8, Bur: "word"}
a7 = &FooBar{Baz: 5, Bur: "strum"}
a8 = FooBar2{Bur: 10, Baz: "feh"}
a9 = (*FooBar)(nil)
a10 = a1[2:5]
a11 = [3]FooBar{{1, "a"}, {2, "b"}, {3, "c"}}
a12 = []FooBar{{4, "d"}, {5, "e"}}
a13 = []*FooBar{{6, "f"}, {7, "g"}, {8, "h"}}
b1 = true
b2 = false
neg = -1
i8 = int8(1)
u8 = uint8(255)
u16 = uint16(65535)
u32 = uint32(4294967295)
u64 = uint64(18446744073709551615)
up = uintptr(5)
f32 = float32(1.2)
c64 = complex(float32(1), float32(2))
c128 = complex(float64(2), float64(3))
i32 = [2]int32{1, 2}
f = barfoo
ms = Nest{0, &Nest{1, &Nest{2, &Nest{3, &Nest{4, nil}}}}} // Test recursion capping
ba = make([]int, 200, 200) // Test array size capping
)
runtime.Breakpoint()
barfoo()
fmt.Println(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, b1, b2, baz, neg, i8, u8, u16, u32, u64, up, f32, c64, c128, i32, bar, f, ms, ba, p1)
}
示例15: Error
func (c *common) Error(args ...interface{}) {
header("Error")
fmt.Println(args...)
runtime.Breakpoint()
hadError = true
}