From 2c726e551d90d20bcd2d78545c369864cc9038e5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 6 Jun 2025 01:32:41 +0200 Subject: Use CSV’s for mintages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mintage/mintage.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/mintage/mintage.go (limited to 'src/mintage/mintage.go') diff --git a/src/mintage/mintage.go b/src/mintage/mintage.go new file mode 100644 index 0000000..cc94de7 --- /dev/null +++ b/src/mintage/mintage.go @@ -0,0 +1,40 @@ +package mintage + +type Data struct { + Standard []SRow + Commemorative []CRow +} + +type SRow struct { + Year int + Mintmark string + Mintages [denoms]int +} + +type CRow struct { + Year int + Name string + Mintmark string + Mintage int +} + +const ( + TypeCirc = iota + TypeNifc + TypeProof +) + +const ( + Unknown = -iota - 1 + Invalid +) + +const denoms = 8 + +var cache map[string][3]Data = make(map[string][3]Data) + +func ClearCache(country string) { + if _, ok := cache[country]; ok { + delete(cache, country) + } +} -- cgit v1.2.3