From a824a9732154f9bee2ce530f753d5747de78aa3f Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 1 Feb 2022 01:10:24 -0500 Subject: internal/feed: split out datatype, add tests --- internal/feed/datatype_string.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 internal/feed/datatype_string.go (limited to 'internal/feed/datatype_string.go') diff --git a/internal/feed/datatype_string.go b/internal/feed/datatype_string.go new file mode 100644 index 0000000..f126add --- /dev/null +++ b/internal/feed/datatype_string.go @@ -0,0 +1,23 @@ +// Code generated by "stringer -linecomment -type=DataType"; DO NOT EDIT. + +package feed + +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[CveType-0] +} + +const _DataType_name = "CVE" + +var _DataType_index = [...]uint8{0, 3} + +func (i DataType) String() string { + if i >= DataType(len(_DataType_index)-1) { + return "DataType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _DataType_name[_DataType_index[i]:_DataType_index[i+1]] +} -- cgit v1.2.3