about summary refs log tree commit diff
path: root/users/wpcarro/tools/monzo_ynab/main.go
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2022-11-21T05·24-0800
committerclbot <clbot@tvl.fyi>2022-11-21T05·30+0000
commitd36aaeb9679a2bc6dfadc53928fe08f081203c0f (patch)
tree100495021a91abaa84bb5a4cdecc36df56f4a637 /users/wpcarro/tools/monzo_ynab/main.go
parent982022826da18904092be5e282f538662802228b (diff)
fix(wpcarro/ynab): Remove .skip-subtree r/5293
**TL;DR:**
- Delete half-baked packaging attempts (`job.nix`, `token.nix`).
- Ensure golang code compiles.
  - Some "packages" were being treated like "programs" presumably for
    debugging/testing purposes back when I was working on this. Make those
    behave like libraries.
  - Remove stale imports.
  - Fix syntax errors.
  - Miscellaneous other chores.
- Drop `shell.nix` and `use_nix` directive.

Change-Id: I63c275680bac55a3cad3b9cb48d51cdc431fbe48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7318
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Diffstat (limited to 'users/wpcarro/tools/monzo_ynab/main.go')
-rw-r--r--users/wpcarro/tools/monzo_ynab/main.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/users/wpcarro/tools/monzo_ynab/main.go b/users/wpcarro/tools/monzo_ynab/main.go
index bf3707138148..900deac0cbdb 100644
--- a/users/wpcarro/tools/monzo_ynab/main.go
+++ b/users/wpcarro/tools/monzo_ynab/main.go
@@ -10,8 +10,11 @@
 package main
 
 import (
+	"monzoClient"
 	"monzoSerde"
 	"os"
+	"ynabClient"
+	"ynabSerde"
 )
 
 var (
@@ -34,11 +37,12 @@ func toYnab(tx monzoSerde.Transaction) ynabSerde.Transaction {
 }
 
 func main() {
+	monzo := monzoClient.Create()
 	txs := monzo.TransactionsLast24Hours()
 	var ynabTxs []ynabSerde.Transaction
-	for tx := range txs {
-		append(ynabTxs, toYnab(tx))
+	for _, tx := range txs {
+		ynabTxs = append(ynabTxs, toYnab(tx))
 	}
-	ynab.PostTransactions(ynabTxs)
+	ynabClient.PostTransactions(ynabTxs)
 	os.Exit(0)
 }