From c9a33075c873c4ef8bb3c695cce721172c31d361 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Tue, 25 Apr 2023 22:53:35 -0400 Subject: Make LgcStatus String()-able Make an LgcStatus type print nicely with %v format verb. --- lgc/lgc.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lgc/lgc.go') diff --git a/lgc/lgc.go b/lgc/lgc.go index b16eb76..db73efa 100644 --- a/lgc/lgc.go +++ b/lgc/lgc.go @@ -41,3 +41,17 @@ const ( LGC_STATUS_DONE LGC_STATUS_ERROR ) + +func (status LgcStatus) String() string { + switch status { + case LGC_STATUS_DONE: + return "Load-Generating Connection Done" + case LGC_STATUS_RUNNING: + return "Load-Generating Connection Running" + case LGC_STATUS_ERROR: + return "Load-Generating Connection Error" + case LGC_STATUS_NOT_STARTED: + return "Load-Generating Connection Not Started" + } + return "Load-Generating Connection in invalid state" +} -- cgit v1.2.3