mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/trace: support event constructor for testing
Implement the new APIs described in #74826. Closes #74826 Change-Id: I6a6a6964229548e9d54e7af95185011e183ee50b Reviewed-on: https://go-review.googlesource.com/c/go/+/691815 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
eb63ef9d66
commit
54b82e944e
6 changed files with 1243 additions and 37 deletions
|
|
@ -58,10 +58,12 @@ func (v Value) String() string {
|
|||
return "Value{Bad}"
|
||||
}
|
||||
|
||||
func uint64Value(x uint64) Value {
|
||||
// Uint64Value creates a value of kind ValueUint64.
|
||||
func Uint64Value(x uint64) Value {
|
||||
return Value{kind: ValueUint64, scalar: x}
|
||||
}
|
||||
|
||||
func stringValue(s string) Value {
|
||||
// StringValue creates a value of kind ValueString.
|
||||
func StringValue(s string) Value {
|
||||
return Value{kind: ValueString, scalar: uint64(len(s)), pointer: unsafe.Pointer(unsafe.StringData(s))}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue