From d36aaeb9679a2bc6dfadc53928fe08f081203c0f Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 20 Nov 2022 21:24:47 -0800 Subject: fix(wpcarro/ynab): Remove .skip-subtree **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 Tested-by: BuildkiteCI Reviewed-by: wpcarro --- users/wpcarro/tools/monzo_ynab/ynab/client.go | 25 +++++-------------------- users/wpcarro/tools/monzo_ynab/ynab/serde.go | 10 +--------- 2 files changed, 6 insertions(+), 29 deletions(-) (limited to 'users/wpcarro/tools/monzo_ynab/ynab') diff --git a/users/wpcarro/tools/monzo_ynab/ynab/client.go b/users/wpcarro/tools/monzo_ynab/ynab/client.go index b3e9930f62..e63010b281 100644 --- a/users/wpcarro/tools/monzo_ynab/ynab/client.go +++ b/users/wpcarro/tools/monzo_ynab/ynab/client.go @@ -1,24 +1,9 @@ -package client +package ynabClient import ( - "serde" + "ynabSerde" ) -// // See requests.txt for more details. -// func PostTransactions(accountID string, txs []serde.Transaction{}) error { -// return map[string]string{ -// "transactions": [ -// { -// "account_id": accountID, -// "date": "2019-12-30", -// "amount": 10000, -// "payee_name": "Richard Stallman", -// "memo": "Not so free software after all...", -// "cleared": "cleared", -// "approved": true, -// "flag_color": "red", -// "import_id": "xyz-123" -// } -// ] -// } -// } +// See requests.txt for more details. +func PostTransactions(txs []ynabSerde.Transaction) { +} diff --git a/users/wpcarro/tools/monzo_ynab/ynab/serde.go b/users/wpcarro/tools/monzo_ynab/ynab/serde.go index 53dd33e836..45dd921b24 100644 --- a/users/wpcarro/tools/monzo_ynab/ynab/serde.go +++ b/users/wpcarro/tools/monzo_ynab/ynab/serde.go @@ -1,10 +1,9 @@ // This package hosts the serialization and deserialization logic for all of the // data types with which our application interacts from the YNAB API. -package main +package ynabSerde import ( "encoding/json" - "fmt" "time" ) @@ -43,10 +42,3 @@ func deserializeTx(x string) (*Transaction, error) { err := json.Unmarshal([]byte(x), target) return target, err } - -func main() { - target, _ := deserializeTx(tx) - out, _ := serializeTx(target) - fmt.Println(out) - fmt.Println(ynabOut) -} -- cgit 1.4.1