From f967a747e4ae01fba3a6c3fd693d0e753faf3ae4 Mon Sep 17 00:00:00 2001 From: anon5 Date: Tue, 22 Jun 2021 16:30:50 +0000 Subject: Add String methods to some types using stringer and fix some minor defects --- lightbank_string.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lightbank_string.go (limited to 'lightbank_string.go') diff --git a/lightbank_string.go b/lightbank_string.go new file mode 100644 index 0000000..ef37758 --- /dev/null +++ b/lightbank_string.go @@ -0,0 +1,24 @@ +// Code generated by "stringer -type LightBank"; DO NOT EDIT. + +package mt + +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[Day-0] + _ = x[Night-1] +} + +const _LightBank_name = "DayNight" + +var _LightBank_index = [...]uint8{0, 3, 8} + +func (i LightBank) String() string { + if i >= LightBank(len(_LightBank_index)-1) { + return "LightBank(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _LightBank_name[_LightBank_index[i]:_LightBank_index[i+1]] +} -- cgit v1.2.3