summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-06-09 03:00:21 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-06-09 03:00:21 +0200
commit5aed031f11a2138365b80697addff6ea6c5e45ac (patch)
tree7a598efbc822b18c6799d3578ea748596e8d723e
parent4defebfff16d81c282ba4a74d1a5143d4ce46f96 (diff)
Simplify code
-rw-r--r--src/dbx/db.go7
-rw-r--r--src/dbx/mintages.go2
2 files changed, 2 insertions, 7 deletions
diff --git a/src/dbx/db.go b/src/dbx/db.go
index 9086265..30f14f7 100644
--- a/src/dbx/db.go
+++ b/src/dbx/db.go
@@ -176,12 +176,7 @@ func scanToStruct[T any](rs *sql.Rows) (T, error) {
}
if strings.Contains(tag, ";") {
- parts := strings.Split(tag, ";")
- tag, dbcols := parts[0], parts[1:]
- if tag != "array" {
- /* TODO: This is bad… it should log something */
- return zero, fmt.Errorf("invalid `db:\"…\"` tag ‘%s’", tag)
- }
+ dbcols := strings.Split(tag, ";")
fv := v.Field(i)
if fv.Kind() != reflect.Array {
return zero, fmt.Errorf("field ‘%s’ is not array",
diff --git a/src/dbx/mintages.go b/src/dbx/mintages.go
index 96cc871..ad13906 100644
--- a/src/dbx/mintages.go
+++ b/src/dbx/mintages.go
@@ -9,7 +9,7 @@ type MSRow struct {
Type int `db:"type"`
Year int `db:"year"`
Mintmark string `db:"mintmark"`
- Mintages [ndenoms]int `db:"array;€0,01;€0,02;€0,05;€0,10;€0,20;€0,50;€1,00;€2,00"`
+ Mintages [ndenoms]int `db:"€0,01;€0,02;€0,05;€0,10;€0,20;€0,50;€1,00;€2,00"`
Reference string `db:"reference"`
}