github.com/gobwas/gtrace@v0.4.3/test/test_gtrace_linux.go (about) 1 // Code generated by gtrace. DO NOT EDIT. 2 3 // +build linux 4 5 package test 6 7 // Compose returns a new ConditionalBuildTrace which has functional fields composed 8 // both from t and x. 9 func (t ConditionalBuildTrace) Compose(x ConditionalBuildTrace) (ret ConditionalBuildTrace) { 10 switch { 11 case t.OnSomething == nil: 12 ret.OnSomething = x.OnSomething 13 case x.OnSomething == nil: 14 ret.OnSomething = t.OnSomething 15 default: 16 h1 := t.OnSomething 17 h2 := x.OnSomething 18 ret.OnSomething = func() { 19 h1() 20 h2() 21 } 22 } 23 return ret 24 } 25 func (t ConditionalBuildTrace) onSomething() { 26 fn := t.OnSomething 27 if fn == nil { 28 return 29 } 30 fn() 31 }