mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-31 22:36:50 -04:00
[etw] Add String() functions, JSON field option (#285)
Add `String()` functions to `etw.Level` and `etw.Opcode` types. Add `etw.JSONStringField()`, which denotes a string field containing JSON data. Fix doc comment casing. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type=Opcode -trimprefix=Opcode"; DO NOT EDIT.
|
||||
|
||||
package etw
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[OpcodeInfo-0]
|
||||
_ = x[OpcodeStart-1]
|
||||
_ = x[OpcodeStop-2]
|
||||
_ = x[OpcodeDCStart-3]
|
||||
_ = x[OpcodeDCStop-4]
|
||||
}
|
||||
|
||||
const _Opcode_name = "InfoStartStopDCStartDCStop"
|
||||
|
||||
var _Opcode_index = [...]uint8{0, 4, 9, 13, 20, 26}
|
||||
|
||||
func (i Opcode) String() string {
|
||||
if i >= Opcode(len(_Opcode_index)-1) {
|
||||
return "Opcode(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Opcode_name[_Opcode_index[i]:_Opcode_index[i+1]]
|
||||
}
|
||||
Reference in New Issue
Block a user