diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-04-02 05:50:21 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-04-02 16:54:27 +0000 |
| commit | 996a961865892d8b81ae3adccb482161e6994c41 (patch) | |
| tree | 3d024909d79621e5dde83c977b7d227f7b910e79 /pkg/fuzzer/queue | |
| parent | fe048bb3c75adb6fef7300aad81e18aabce4a075 (diff) | |
pkg/fuzzer/queue: add Status.String
Otherwise it's hard to understand in error messages what 1/2/3 mean.
Diffstat (limited to 'pkg/fuzzer/queue')
| -rw-r--r-- | pkg/fuzzer/queue/queue.go | 1 | ||||
| -rw-r--r-- | pkg/fuzzer/queue/status_string.go | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/pkg/fuzzer/queue/queue.go b/pkg/fuzzer/queue/queue.go index 37e69837f..ca2d76092 100644 --- a/pkg/fuzzer/queue/queue.go +++ b/pkg/fuzzer/queue/queue.go @@ -213,6 +213,7 @@ func (r *Result) GlobFiles() []string { type Status int +//go:generate go run golang.org/x/tools/cmd/stringer -type Status const ( Success Status = iota ExecFailure // For e.g. serialization errors. diff --git a/pkg/fuzzer/queue/status_string.go b/pkg/fuzzer/queue/status_string.go new file mode 100644 index 000000000..91ecb497e --- /dev/null +++ b/pkg/fuzzer/queue/status_string.go @@ -0,0 +1,27 @@ +// Code generated by "stringer -type Status"; DO NOT EDIT. + +package queue + +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[Success-0] + _ = x[ExecFailure-1] + _ = x[Crashed-2] + _ = x[Restarted-3] + _ = x[Hanged-4] +} + +const _Status_name = "SuccessExecFailureCrashedRestartedHanged" + +var _Status_index = [...]uint8{0, 7, 18, 25, 34, 40} + +func (i Status) String() string { + if i < 0 || i >= Status(len(_Status_index)-1) { + return "Status(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Status_name[_Status_index[i]:_Status_index[i+1]] +} |
