From 06b553ab3f6355e643049dad0ccb570a0bc0d613 Mon Sep 17 00:00:00 2001 From: kaa Date: Sat, 25 Nov 2023 12:40:23 -0800 Subject: WIP Directory traversal using go. --- cantree/test/example.json | 1 + cantree/test/t.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 cantree/test/example.json create mode 100644 cantree/test/t.go (limited to 'cantree/test') diff --git a/cantree/test/example.json b/cantree/test/example.json new file mode 100644 index 0000000..9fb056c --- /dev/null +++ b/cantree/test/example.json @@ -0,0 +1 @@ +{"id":17428885,"name":"my files","full_name":"my files","context_id":9064950,"context_type":"User","parent_folder_id":null,"created_at":"2023-08-18T04:06:27Z","updated_at":"2023-08-18T04:06:27Z","lock_at":null,"unlock_at":null,"position":null,"locked":false,"folders_url":"https://sdccd.instructure.com/api/v1/folders/17428885/folders","files_url":"https://sdccd.instructure.com/api/v1/folders/17428885/files","files_count":15,"folders_count":10,"hidden":null,"locked_for_user":false,"hidden_for_user":false,"for_submissions":false,"can_upload":true} diff --git a/cantree/test/t.go b/cantree/test/t.go new file mode 100644 index 0000000..203d6b9 --- /dev/null +++ b/cantree/test/t.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "encoding/json" + "io" + "os" +) + +func main() { + in, _ := os.Open("example.json") + contents, _ := io.ReadAll(in) + + var m map[string]interface{} + json.Unmarshal(contents, &m) + fmt.Printf("%v\n", m) +} \ No newline at end of file -- cgit v1.2.3