From e0b67ce0faa3b5f0f1573b042a2cd96f700fabbc Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Sun, 14 Apr 2019 11:36:01 -0500 Subject: [PATCH] Revert "test: write example files to disk rather than stdout" This reverts commit 3c92d21b73edca86f323e4714b8c49bf520903b0. --- batch_test.go | 2 +- test/ach-ack-read/ack-read.ach | 6 +++--- test/ach-ack-write/main.go | 11 +---------- test/ach-adv-read/adv-read.ach | 6 +++--- test/ach-adv-write/main.go | 11 +---------- test/ach-arc-read/arc-debit.ach | 6 +++--- test/ach-arc-write/main.go | 11 +---------- test/ach-atx-read/atx-read.ach | 6 +++--- test/ach-atx-write/main.go | 11 +---------- test/ach-boc-read/boc-debit.ach | 6 +++--- test/ach-boc-write/main.go | 11 +---------- test/ach-ccd-read/ccd-debit.ach | 6 +++--- test/ach-ccd-write/main.go | 11 +---------- test/ach-cie-read/cie-credit.ach | 6 +++--- test/ach-cie-write/main.go | 11 +---------- test/ach-ctx-read/ctx-debit.ach | 6 +++--- test/ach-ctx-write/main.go | 11 +---------- test/ach-dne-read/dne-read.ach | 4 ++-- test/ach-dne-write/main.go | 11 +---------- test/ach-enr-read/enr-read.ach | 2 +- test/ach-enr-write/main.go | 11 +---------- test/ach-iat-read/iat-credit.ach | 4 ++-- test/ach-iat-write/main.go | 11 +---------- test/ach-mte-read/mte-read.ach | 4 ++-- test/ach-mte-write/main.go | 11 +---------- test/ach-pop-read/pop-debit.ach | 6 +++--- test/ach-pop-write/main.go | 11 +---------- test/ach-pos-read/pos-debit.ach | 6 +++--- test/ach-pos-write/main.go | 11 +---------- test/ach-ppd-read/ppd-debit.ach | 15 +++++---------- test/ach-ppd-write/main.go | 11 +---------- test/ach-rck-read/rck-debit.ach | 4 ++-- test/ach-rck-write/main.go | 11 +---------- test/ach-shr-read/shr-debit.ach | 6 +++--- test/ach-shr-write/main.go | 11 +---------- test/ach-tel-read/tel-debit.ach | 6 +++--- test/ach-tel-write/main.go | 11 +---------- test/ach-trc-read/trc-debit.ach | 6 +++--- test/ach-trc-write/main.go | 11 +---------- test/ach-trx-read/trx-debit.ach | 6 +++--- test/ach-trx-write/main.go | 11 +---------- test/ach-web-read/web-credit.ach | 6 +++--- test/ach-web-write/main.go | 11 +---------- test/ach-xck-read/xck-debit.ach | 6 +++--- test/ach-xck-write/main.go | 11 +---------- 45 files changed, 85 insertions(+), 288 deletions(-) diff --git a/batch_test.go b/batch_test.go index f0f01b1d1..e9dca5a4c 100644 --- a/batch_test.go +++ b/batch_test.go @@ -101,7 +101,7 @@ func TestBatch__UnmarshalJSON(t *testing.T) { t.Error("file == nil") } - if v := file.Header.FileCreationDate; v != time.Now().Format("060102") { // YYMMDD + if v := file.Header.FileCreationDate; v != "180614" { t.Errorf("got FileCreationDate of %q", v) } if v := file.Header.FileCreationTime; v != "0000" { diff --git a/test/ach-ack-read/ack-read.ach b/test/ach-ack-read/ack-read.ach index d1d4e4f66..7f41972dd 100644 --- a/test/ach-ack-read/ack-read.ach +++ b/test/ach-ack-read/ack-read.ach @@ -1,5 +1,5 @@ -101 031300012 2313801041904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 231380104 ACKVndr Pay 190413 1231380100000001 +101 031300012 2313801041810290000A094101Federal Reserve Bank My Bank Name +5220Name on Account 231380104 ACKVndr Pay 181030 1231380100000001 624031300012744-5678-99 0000000000031300010000001Best. #1 0231380100000001 624031300012744-5678-99 0000000000031300010000002Best. #1 0231380100000002 82200000020006260002000000000000000000000000231380104 231380100000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-ack-write/main.go b/test/ach-ack-write/main.go index 5cb09029f..f554097eb 100644 --- a/test/ach-ack-write/main.go +++ b/test/ach-ack-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -70,15 +69,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-ack-read", "ack-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-adv-read/adv-read.ach b/test/ach-adv-read/adv-read.ach index ef42b84a2..02f7b55f7 100644 --- a/test/ach-adv-read/adv-read.ach +++ b/test/ach-adv-read/adv-read.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5280Company Name, In 121042882 ADVAccounting 190413 0121042880000001 +101 231380104 1210428821811130000A094101Federal Reserve Bank My Bank Name +5280Company Name, In 121042882 ADVAccounting 181114 0121042880000001 681231380104744-5678-99 00000005000012104288211131 Name 0011000010500001 682231380104744-5678-99 00000025000012104288211139 Name 0011000010500002 828000000200462760200000000000000025000000000000000000050000Company Name, Inc 121042880000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-adv-write/main.go b/test/ach-adv-write/main.go index 9baebaae9..8acc9c1c1 100644 --- a/test/ach-adv-write/main.go +++ b/test/ach-adv-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -82,15 +81,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-adv-read", "adv-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-arc-read/arc-debit.ach b/test/ach-arc-read/arc-debit.ach index a45ceb804..f654f82eb 100644 --- a/test/ach-arc-read/arc-debit.ach +++ b/test/ach-arc-read/arc-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Payee Name 121042882 ARCACH ARC 190413 1121042880000001 +101 231380104 1210428821806070000A094101Federal Reserve Bank My Bank Name +5225Payee Name 121042882 ARCACH ARC 180608 1121042880000001 62723138010412345678 0000250000123879654 ABC Company 0121042880000001 82250000010023138010000000250000000000000000121042882 121042880000001 9000001000001000000010023138010000000250000000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-arc-write/main.go b/test/ach-arc-write/main.go index 827695008..d6d21f85d 100644 --- a/test/ach-arc-write/main.go +++ b/test/ach-arc-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -58,15 +57,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-arc-read", "arc-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-atx-read/atx-read.ach b/test/ach-atx-read/atx-read.ach index bc85f804d..3eee21216 100644 --- a/test/ach-atx-read/atx-read.ach +++ b/test/ach-atx-read/atx-read.ach @@ -1,5 +1,5 @@ -101 031300012 2313801041904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 231380104 ATXVndr Pay 190413 1231380100000001 +101 031300012 2313801041810290000A094101Federal Reserve Bank My Bank Name +5220Name on Account 231380104 ATXVndr Pay 181030 1231380100000001 624031300012744-5678-99 00000000000313000100000010002Receiver Company 011231380100000001 705Credit account 1 for service 00010000001 705Credit account 2 for service 00020000001 @@ -7,4 +7,4 @@ 705Credit account 1 for leadership 00010000002 705Credit account 2 for leadership 00020000002 82200000060006260002000000000000000000000000231380104 231380100000001 -9000001000001000000060006260002000000000000000000000000 +9000001000001000000060006260002000000000000000000000000 \ No newline at end of file diff --git a/test/ach-atx-write/main.go b/test/ach-atx-write/main.go index a0c6336ba..e6c121d08 100644 --- a/test/ach-atx-write/main.go +++ b/test/ach-atx-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -100,15 +99,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-atx-read", "atx-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-boc-read/boc-debit.ach b/test/ach-boc-read/boc-debit.ach index 95d3edd56..256e9120e 100644 --- a/test/ach-boc-read/boc-debit.ach +++ b/test/ach-boc-read/boc-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Payee Name 121042882 BOCACH BOC 190413 1121042880000001 +101 231380104 1210428821806070000A094101Federal Reserve Bank My Bank Name +5225Payee Name 121042882 BOCACH BOC 180608 1121042880000001 62723138010412345678 0000250000123879654 ABC Company 0121042880000001 82250000010023138010000000250000000000000000121042882 121042880000001 9000001000001000000010023138010000000250000000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-boc-write/main.go b/test/ach-boc-write/main.go index 54ccd7e3f..a02b8abad 100644 --- a/test/ach-boc-write/main.go +++ b/test/ach-boc-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -58,15 +57,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-boc-read", "boc-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-ccd-read/ccd-debit.ach b/test/ach-ccd-read/ccd-debit.ach index dffc6daa5..d64f2d0c5 100644 --- a/test/ach-ccd-read/ccd-debit.ach +++ b/test/ach-ccd-read/ccd-debit.ach @@ -1,5 +1,5 @@ -101 231380104 0313000121904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 031300012 CCDVndr Pay 190413 1031300010000001 +101 231380104 0313000121811260000A094101Federal Reserve Bank My Bank Name +5225Name on Account 031300012 CCDVndr Pay 181127 1031300010000001 627231380104744-5678-99 0000500000location #1 Best Co. #1 S 0031300010000001 627231380104744-5678-99 0000000125Fee #1 Best Co. #1 S 0031300010000002 82250000020046276020000000500125000000000000031300012 031300010000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-ccd-write/main.go b/test/ach-ccd-write/main.go index 54b11fedd..54a5652f9 100644 --- a/test/ach-ccd-write/main.go +++ b/test/ach-ccd-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -72,15 +71,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-ccd-read", "ccd-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-cie-read/cie-credit.ach b/test/ach-cie-read/cie-credit.ach index d0b41a177..f994aa266 100644 --- a/test/ach-cie-read/cie-credit.ach +++ b/test/ach-cie-read/cie-credit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 121042882 CIEPayment 190413 1121042880000001 +101 231380104 1210428821806200000A094101Federal Reserve Bank My Bank Name +5220Name on Account 121042882 CIEPayment 180621 1121042880000001 62223138010412345678 0100000000 Receiver Account Name 011121042880000001 705Credit Store Account 00010000001 82200000020023138010000000000000000100000000121042882 121042880000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-cie-write/main.go b/test/ach-cie-write/main.go index 247d7a58a..01d216d70 100644 --- a/test/ach-cie-write/main.go +++ b/test/ach-cie-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -68,15 +67,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-cie-read", "cie-credit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-ctx-read/ctx-debit.ach b/test/ach-ctx-read/ctx-debit.ach index 57d9f099c..1efd7c503 100644 --- a/test/ach-ctx-read/ctx-debit.ach +++ b/test/ach-ctx-read/ctx-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 121042882 CTXACH CTX 190413 1121042880000001 +101 231380104 1210428821811260000A094101Federal Reserve Bank My Bank Name +5225Name on Account 121042882 CTXACH CTX 181127 1121042880000001 62723138010412345678 010000000045689033 0002Receiver Company 011121042880000001 705Debit First Account 00010000001 705Debit Second Account 00020000001 @@ -7,4 +7,4 @@ 9000001000001000000030023138010000100000000000000000000 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-ctx-write/main.go b/test/ach-ctx-write/main.go index c408f3971..6944cce22 100644 --- a/test/ach-ctx-write/main.go +++ b/test/ach-ctx-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -75,15 +74,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-ctx-read", "ctx-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-dne-read/dne-read.ach b/test/ach-dne-read/dne-read.ach index 54b40c0aa..10150c532 100644 --- a/test/ach-dne-read/dne-read.ach +++ b/test/ach-dne-read/dne-read.ach @@ -1,5 +1,5 @@ -101 031300012 2313801041904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 231380104 DNEDeath 190413 2231380100000001 +101 031300012 2313801041811020000A094101Federal Reserve Bank My Bank Name +5220Name on Account 231380104 DNEDeath 181103 2231380100000001 621031300012744-5678-99 0000000000031300010000001Best. #1 1231380100000001 705 DATE OF DEATH*010218*CUSTOMERSSN*#########*AMOUNT*$$$$.cc\ 00010000001 82200000020003130001000000000000000000000000231380104 231380100000001 diff --git a/test/ach-dne-write/main.go b/test/ach-dne-write/main.go index 2bbe8ce1d..872020d97 100644 --- a/test/ach-dne-write/main.go +++ b/test/ach-dne-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -66,15 +65,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-dne-read", "dne-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-enr-read/enr-read.ach b/test/ach-enr-read/enr-read.ach index d4c530d6d..7a89299c1 100644 --- a/test/ach-enr-read/enr-read.ach +++ b/test/ach-enr-read/enr-read.ach @@ -1,4 +1,4 @@ -101 031300012 2313801041904120000A094101Federal Reserve Bank My Bank Name +101 031300012 2313801041811260000A094101Federal Reserve Bank My Bank Name 5225Name on Account 231380104 ENRAUTOENROLL 1231380100000001 627031300012744-5678-99 0000000000031300010000001Best. #1 1231380100000001 70522*12200004*3*123987654321*777777777*DOE*JOHN*1\ 00010000001 diff --git a/test/ach-enr-write/main.go b/test/ach-enr-write/main.go index d6acfe63b..d43b3042f 100644 --- a/test/ach-enr-write/main.go +++ b/test/ach-enr-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -64,15 +63,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-enr-read", "enr-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-iat-read/iat-credit.ach b/test/ach-iat-read/iat-credit.ach index 1e17a32eb..536bd005e 100644 --- a/test/ach-iat-read/iat-credit.ach +++ b/test/ach-iat-read/iat-credit.ach @@ -1,5 +1,5 @@ -101 121042882 2313801041904120000A094101Bank My Bank Name -5225 FF3 US123456789 IATTRADEPAYMTCADUSD190413 0231380100000001 +101 121042882 2313801041812180000A094101Bank My Bank Name +5225 FF3 US123456789 IATTRADEPAYMTCADUSD181219 1231380100000001 6221210428820007 0000100000123456789 1231380100000001 710ANN000000000000100000928383-23938 BEK Enterprises 0000001 711BEK Solutions 15 West Place Street 0000001 diff --git a/test/ach-iat-write/main.go b/test/ach-iat-write/main.go index 5dca7c3ed..ccfba3c3c 100644 --- a/test/ach-iat-write/main.go +++ b/test/ach-iat-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -128,15 +127,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-iat-read", "iat-credit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-mte-read/mte-read.ach b/test/ach-mte-read/mte-read.ach index 789f6e15b..e30ac9bbb 100644 --- a/test/ach-mte-read/mte-read.ach +++ b/test/ach-mte-read/mte-read.ach @@ -1,5 +1,5 @@ -101 031300012 2313801041904120000A094101Federal Reserve Bank My Bank Name -5225Merchant with AT 231380104 MTECASH WITHD 190413 1231380100000001 +101 031300012 2313801041812180000A094101Federal Reserve Bank My Bank Name +5225Merchant with AT 231380104 MTECASH WITHD 181219 1231380100000001 627031300012744-5678-99 0000010000031300010000001JANE DOE 1231380100000001 702 2005091234561224 321 East Market Street ANYTOWN VA231380100000001 82250000020003130001000000010000000000000000231380104 231380100000001 diff --git a/test/ach-mte-write/main.go b/test/ach-mte-write/main.go index 3b0979898..01c6a14c2 100644 --- a/test/ach-mte-write/main.go +++ b/test/ach-mte-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -73,15 +72,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-mte-read", "mte-read.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-pop-read/pop-debit.ach b/test/ach-pop-read/pop-debit.ach index b554dcdaa..3e817f577 100644 --- a/test/ach-pop-read/pop-debit.ach +++ b/test/ach-pop-read/pop-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Originator 121042882 POPACH POP 190413 1121042880000001 +101 231380104 1210428821806070000A094101Federal Reserve Bank My Bank Name +5225Originator 121042882 POPACH POP 180608 1121042880000001 62723138010412345678 0000250500123456 PHILPAWade Arnold 0121042880000001 82250000010023138010000000250500000000000000121042882 121042880000001 9000001000001000000010023138010000000250500000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-pop-write/main.go b/test/ach-pop-write/main.go index 208f16352..edbfdbec1 100644 --- a/test/ach-pop-write/main.go +++ b/test/ach-pop-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -60,15 +59,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-pop-read", "pop-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-pos-read/pos-debit.ach b/test/ach-pos-read/pos-debit.ach index 9394ab79d..b62960f0d 100644 --- a/test/ach-pos-read/pos-debit.ach +++ b/test/ach-pos-read/pos-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 121042882 POSSale 190413 1121042880000001 +101 231380104 1210428821806140000A094101Federal Reserve Bank My Bank Name +5225Name on Account 121042882 POSREG.SALARY 180615 1121042880000001 62723138010412345678 0100000000 Receiver Account Name 011121042880000001 702REFONEAREFTERM021000490614123456Target Store 0049 PHILADELPHIA PA121042880000001 82250000020023138010000100000000000000000000121042882 121042880000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-pos-write/main.go b/test/ach-pos-write/main.go index 41b32acbc..69ee7d45e 100644 --- a/test/ach-pos-write/main.go +++ b/test/ach-pos-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -74,15 +73,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-pos-read", "pos-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-ppd-read/ppd-debit.ach b/test/ach-ppd-read/ppd-debit.ach index 8ae71bc65..aae128d4e 100644 --- a/test/ach-ppd-read/ppd-debit.ach +++ b/test/ach-ppd-read/ppd-debit.ach @@ -1,10 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 121042882 PPDREG.SALARY 190413 1121042880000001 -62223138010412345678 0100000000 Receiver Account Name 0121042880000001 -82200000010023138010000000000000000100000000121042882 121042880000001 -9000001000001000000010023138010000000000000000100000000 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +101 076401251 0764012510807291511A094101achdestname companyname +5225companyname origid PPDCHECKPAYMT000002080730 1076401250000001 +62705320001912345 0000010500c-1 Bachman Eric DD0076401255655291 +82250000010005320001000000010500000000000000origid 076401250000001 +9000001000001000000010005320001000000010500000000000000 \ No newline at end of file diff --git a/test/ach-ppd-write/main.go b/test/ach-ppd-write/main.go index 031620792..2fc6071af 100644 --- a/test/ach-ppd-write/main.go +++ b/test/ach-ppd-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -59,15 +58,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-ppd-read", "ppd-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-rck-read/rck-debit.ach b/test/ach-rck-read/rck-debit.ach index 9c79ac81a..584bd9e89 100644 --- a/test/ach-rck-read/rck-debit.ach +++ b/test/ach-rck-read/rck-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 121042882 RCKREDEPCHECK 190413 1121042880000001 +101 231380104 1210428821805310000A094101Federal Reserve Bank My Bank Name +5225Name on Account 121042882 RCKREDEPCHECK 180601 1121042880000001 62723138010412345678 0000002400123123123 Wade Arnold 0121042880000001 82250000010023138010000000002400000000000000121042882 121042880000001 9000001000001000000010023138010000000002400000000000000 diff --git a/test/ach-rck-write/main.go b/test/ach-rck-write/main.go index 5f84cee5f..2d2bc6858 100644 --- a/test/ach-rck-write/main.go +++ b/test/ach-rck-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -58,15 +57,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-rck-read", "rck-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-shr-read/shr-debit.ach b/test/ach-shr-read/shr-debit.ach index 8f96a33f1..3a2800b8a 100644 --- a/test/ach-shr-read/shr-debit.ach +++ b/test/ach-shr-read/shr-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 121042882 SHRPayment 190413 1121042880000001 +101 231380104 1210428821806190000A094101Federal Reserve Bank My Bank Name +5225Name on Account 121042882 SHRPayment 180620 1121042880000001 62723138010412345678 01000000000722123456789100001234567891123456789011121042880000001 702REFONEAREFTERM021000490614123456Target Store 0049 PHILADELPHIA PA121042880000001 82250000020023138010000100000000000000000000121042882 121042880000001 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-shr-write/main.go b/test/ach-shr-write/main.go index 23b0e7d65..b4e27ddff 100644 --- a/test/ach-shr-write/main.go +++ b/test/ach-shr-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -76,15 +75,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-shr-read", "shr-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-tel-read/tel-debit.ach b/test/ach-tel-read/tel-debit.ach index ce9cc330b..d7f8db66d 100644 --- a/test/ach-tel-read/tel-debit.ach +++ b/test/ach-tel-read/tel-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Receiver Bank Name My Bank Name -5225Name on Account 121042882 TELPayment 190413 1121042880000001 +101 231380104 1210428821812060000A094101Receiver Bank Name My Bank Name +5225Name on Account 121042882 TELPayment 181207 1121042880000001 62723138010412345678 0000050000 Receiver Account Name 0121042880000001 82250000010023138010000000050000000000000000121042882 121042880000001 9000001000001000000010023138010000000050000000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-tel-write/main.go b/test/ach-tel-write/main.go index 07c73be1d..74cc2b8d5 100644 --- a/test/ach-tel-write/main.go +++ b/test/ach-tel-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -59,15 +58,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-tel-read", "tel-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-trc-read/trc-debit.ach b/test/ach-trc-read/trc-debit.ach index 725e702de..499aff41e 100644 --- a/test/ach-trc-read/trc-debit.ach +++ b/test/ach-trc-read/trc-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Payee Name 121042882 TRCACH TRC 190413 1121042880000001 +101 231380104 1210428821811140000A094101Federal Reserve Bank My Bank Name +5225Payee Name 121042882 TRCACH TRC 181115 1121042880000001 62723138010412345678 0000250000123879654 CHECK1182726 010121042880000001 82250000010023138010000000250000000000000000121042882 121042880000001 9000001000001000000010023138010000000250000000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-trc-write/main.go b/test/ach-trc-write/main.go index 67d964e93..c358177f5 100644 --- a/test/ach-trc-write/main.go +++ b/test/ach-trc-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -60,15 +59,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-trc-read", "trc-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-trx-read/trx-debit.ach b/test/ach-trx-read/trx-debit.ach index 7291068a5..f6db9ac5a 100644 --- a/test/ach-trx-read/trx-debit.ach +++ b/test/ach-trx-read/trx-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Name on Account 121042882 TRXACH TRX 190413 1121042880000001 +101 231380104 1210428821811140000A094101Federal Reserve Bank My Bank Name +5225Name on Account 121042882 TRXACH TRX 181115 1121042880000001 62723138010412345678 000025000045689033 0002Receiver Company 011121042880000001 705Debit First Account 00010000001 705Debit Second Account 00020000001 @@ -7,4 +7,4 @@ 9000001000001000000030023138010000000250000000000000000 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-trx-write/main.go b/test/ach-trx-write/main.go index bce438f0a..54dbf7eca 100644 --- a/test/ach-trx-write/main.go +++ b/test/ach-trx-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -75,15 +74,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-trx-read", "trx-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-web-read/web-credit.ach b/test/ach-web-read/web-credit.ach index 858dd088e..95761809a 100644 --- a/test/ach-web-read/web-credit.ach +++ b/test/ach-web-read/web-credit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5220Name on Account 121042882 WEBSubscribe 190413 1121042880000001 +101 231380104 1210428821810110000A094101Federal Reserve Bank My Bank Name +5220Name on Account 121042882 WEBSubscribe 181012 1121042880000001 62223138010412345678 0000010000#789654 Wade Arnold S 1121042880000001 705PAY-GATE payment 00010000001 62223138010481967038518 0000000799#123456 Wade Arnold R 1121042880000002 @@ -7,4 +7,4 @@ 82200000040046276020000000000000000000010799121042882 121042880000001 9000001000001000000040046276020000000000000000000010799 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-web-write/main.go b/test/ach-web-write/main.go index 087196bbf..ad2d110ac 100644 --- a/test/ach-web-write/main.go +++ b/test/ach-web-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -83,15 +82,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-web-read", "web-credit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) } diff --git a/test/ach-xck-read/xck-debit.ach b/test/ach-xck-read/xck-debit.ach index 45df42039..bdf6989fb 100644 --- a/test/ach-xck-read/xck-debit.ach +++ b/test/ach-xck-read/xck-debit.ach @@ -1,5 +1,5 @@ -101 231380104 1210428821904120000A094101Federal Reserve Bank My Bank Name -5225Payee Name 121042882 XCKACH XCK 190413 1121042880000001 +101 231380104 1210428821811140000A094101Federal Reserve Bank My Bank Name +5225Payee Name 121042882 XCKACH XCK 181115 1121042880000001 62723138010412345678 0000250000123879654 CHECK1182726 0121042880000001 82250000010023138010000000250000000000000000121042882 121042880000001 9000001000001000000010023138010000000250000000000000000 @@ -7,4 +7,4 @@ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 \ No newline at end of file diff --git a/test/ach-xck-write/main.go b/test/ach-xck-write/main.go index 93e82c0b0..77069d81c 100644 --- a/test/ach-xck-write/main.go +++ b/test/ach-xck-write/main.go @@ -3,7 +3,6 @@ package main import ( "log" "os" - "path/filepath" "time" "github.com/moov-io/ach" @@ -59,15 +58,7 @@ func main() { } // write the file to std out. Anything io.Writer - fd, err := os.Create(filepath.Join("..", "ach-xck-read", "xck-debit.ach")) - if err != nil { - log.Fatalf("Unexpected error creating output file: %s\n", err) - } - defer func() { - fd.Sync() - fd.Close() - }() - w := ach.NewWriter(fd) + w := ach.NewWriter(os.Stdout) if err := w.Write(file); err != nil { log.Fatalf("Unexpected error: %s\n", err) }