-
Notifications
You must be signed in to change notification settings - Fork 10
/
test_tags_gtrace_stub.go
137 lines (129 loc) · 3.18 KB
/
test_tags_gtrace_stub.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Code generated by gtrace. DO NOT EDIT.
// +build !gtrace
package test
import (
"bytes"
"context"
)
// Compose returns a new BuildTagTrace which has functional fields composed
// both from t and x.
func (t BuildTagTrace) Compose(x BuildTagTrace) (ret BuildTagTrace) {
switch {
case t.OnSomethingA == nil:
ret.OnSomethingA = x.OnSomethingA
case x.OnSomethingA == nil:
ret.OnSomethingA = t.OnSomethingA
default:
h1 := t.OnSomethingA
h2 := x.OnSomethingA
ret.OnSomethingA = func() func() {
r1 := h1()
r2 := h2()
switch {
case r1 == nil:
return r2
case r2 == nil:
return r1
default:
return func() {
r1()
r2()
}
}
}
}
switch {
case t.OnSomethingB == nil:
ret.OnSomethingB = x.OnSomethingB
case x.OnSomethingB == nil:
ret.OnSomethingB = t.OnSomethingB
default:
h1 := t.OnSomethingB
h2 := x.OnSomethingB
ret.OnSomethingB = func(i int8, i1 int16) func(int32, int64) {
r1 := h1(i, i1)
r2 := h2(i, i1)
switch {
case r1 == nil:
return r2
case r2 == nil:
return r1
default:
return func(i int32, i1 int64) {
r1(i, i1)
r2(i, i1)
}
}
}
}
switch {
case t.OnSomethingC == nil:
ret.OnSomethingC = x.OnSomethingC
case x.OnSomethingC == nil:
ret.OnSomethingC = t.OnSomethingC
default:
h1 := t.OnSomethingC
h2 := x.OnSomethingC
ret.OnSomethingC = func(t Type) func(Type) {
r1 := h1(t)
r2 := h2(t)
switch {
case r1 == nil:
return r2
case r2 == nil:
return r1
default:
return func(t Type) {
r1(t)
r2(t)
}
}
}
}
return ret
}
type buildTagTraceContextKey struct{}
// WithBuildTagTrace returns context which has associated BuildTagTrace with it.
func WithBuildTagTrace(ctx context.Context, t BuildTagTrace) context.Context {
return context.WithValue(ctx,
buildTagTraceContextKey{},
ContextBuildTagTrace(ctx).Compose(t),
)
}
// ContextBuildTagTrace returns BuildTagTrace associated with ctx.
// If there is no BuildTagTrace associated with ctx then zero value
// of BuildTagTrace is returned.
func ContextBuildTagTrace(ctx context.Context) BuildTagTrace {
t, _ := ctx.Value(buildTagTraceContextKey{}).(BuildTagTrace)
return t
}
func gtraceNoopDe11bf52() {
}
func (BuildTagTrace) onSomethingA(context.Context) func() {
return gtraceNoopDe11bf52
}
func gtraceNoop61afed37(int32, int64) {
}
func (BuildTagTrace) onSomethingB(context.Context, int8, int16) func(int32, int64) {
return gtraceNoop61afed37
}
func gtraceNoop8bdd2eba(Type) {
}
func (BuildTagTrace) onSomethingC(context.Context, Type) func(Type) {
return gtraceNoop8bdd2eba
}
func gtraceNoopDe11bf521() {
}
func buildTagTraceOnSomethingA(context.Context, BuildTagTrace) func() {
return gtraceNoopDe11bf521
}
func gtraceNoop61afed371(int32, int64) {
}
func buildTagTraceOnSomethingB(context.Context, BuildTagTrace, int8, int16) func(int32, int64) {
return gtraceNoop61afed371
}
func gtraceNoop8bdd2eba1(Embeded, string, int, bool, error, bytes.Reader) {
}
func buildTagTraceOnSomethingC(ctx context.Context, t BuildTagTrace, e Embeded, s string, integer int, boolean bool, e1 error, r bytes.Reader) func(_ Embeded, _ string, integer int, boolean bool, _ error, _ bytes.Reader) {
return gtraceNoop8bdd2eba1
}