diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-10 20:16:48 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-10 20:16:48 +0200 |
commit | 2e0d8c3889590253b091de5d1c12b1a4dadf1c8f (patch) | |
tree | f2854f3d4c0be012486721246f80ec55186b9403 /cmd/mfmt | |
parent | d5c3c5f0f05e2f88dae1992c3269c01a0b924b49 (diff) |
Do some renaming
Diffstat (limited to 'cmd/mfmt')
-rw-r--r-- | cmd/mfmt/main.go | 18 | ||||
-rw-r--r-- | cmd/mfmt/util_test.go | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/cmd/mfmt/main.go b/cmd/mfmt/main.go index b8e0722..5ff2a0a 100644 --- a/cmd/mfmt/main.go +++ b/cmd/mfmt/main.go @@ -8,11 +8,11 @@ import ( "strings" "unsafe" - "git.thomasvoss.com/euro-cash.eu/mintages" + "git.thomasvoss.com/euro-cash.eu/mintage" ) -const cols = unsafe.Sizeof(mintages.Row{}.Cols) / - unsafe.Sizeof(mintages.Row{}.Cols[0]) +const cols = unsafe.Sizeof(mintage.Row{}.Cols) / + unsafe.Sizeof(mintage.Row{}.Cols[0]) var rv int @@ -37,7 +37,7 @@ func main() { } func mfmt(path string, in io.Reader, out io.Writer) error { - data, err := mintages.Parse(in, path) + data, err := mintage.Parse(in, path) if err != nil { return err } @@ -75,7 +75,7 @@ func mfmt(path string, in io.Reader, out io.Writer) error { return nil } -func formatSection(out io.Writer, rows []mintages.Row) { +func formatSection(out io.Writer, rows []mintage.Row) { var ( year string longestMM int @@ -133,9 +133,9 @@ func formatSection(out io.Writer, rows []mintages.Row) { } func formatInt(n int) string { - if n <= mintages.Invalid { + if n <= mintage.Invalid { panic(fmt.Sprintf("invalid input %d", n)) - } else if n == mintages.Unknown { + } else if n == mintage.Unknown { return "?" } @@ -158,9 +158,9 @@ func formatInt(n int) string { func intlen(v int) int { switch { - case v <= mintages.Invalid: + case v <= mintage.Invalid: panic("mintage count is negative and not -1") - case v == 0, v == mintages.Unknown: + case v == 0, v == mintage.Unknown: return 1 default: n := 0 diff --git a/cmd/mfmt/util_test.go b/cmd/mfmt/util_test.go index e008e0b..af97146 100644 --- a/cmd/mfmt/util_test.go +++ b/cmd/mfmt/util_test.go @@ -6,7 +6,7 @@ package main import ( "testing" - "git.thomasvoss.com/euro-cash.eu/mintages" + "git.thomasvoss.com/euro-cash.eu/mintage" ) func TestFormatInt(t *testing.T) { @@ -18,7 +18,7 @@ func TestFormatInt(t *testing.T) { {123, "123"}, {81758, "81.758"}, {752759237528, "752.759.237.528"}, - {mintages.Unknown, "?"}, + {mintage.Unknown, "?"}, } { s := formatInt(x.n) if s != x.s { @@ -33,7 +33,7 @@ func TestIntLen(t *testing.T) { {123, len("123")}, {81758, len("81758")}, {752759237528, len("752759237528")}, - {mintages.Unknown, len("?")}, + {mintage.Unknown, len("?")}, } { n := intlen(x.x) if n != x.y { |