diff options
author | anon5 <anon5clam@protonmail.com> | 2021-06-22 16:30:50 +0000 |
---|---|---|
committer | anon5 <anon5clam@protonmail.com> | 2021-06-22 16:30:50 +0000 |
commit | f967a747e4ae01fba3a6c3fd693d0e753faf3ae4 (patch) | |
tree | 22d628df079bb5cac93cc2338cfbe585ff8a2763 /lightbank_string.go | |
parent | 425da65ed46061303604610bb539d6495b2b1f3f (diff) | |
download | mt-f967a747e4ae01fba3a6c3fd693d0e753faf3ae4.tar.xz |
Add String methods to some types using stringer and fix some minor defects
Diffstat (limited to 'lightbank_string.go')
-rw-r--r-- | lightbank_string.go | 24 |
1 files changed, 24 insertions, 0 deletions
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]] +} |