From daeb9127764fc9dd469294f755e277fdfca09a00 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Wed, 10 Jun 2026 00:07:56 +0200 Subject: rtree: add support for multiple URLs per remote This requires changing the index format, which I'm using as an opportunity to: - move from YAML to JSON (so I can maybe kill the YAML parser dependency at some point) - move the index file into standard XDG paths --- internal/rtree/shared_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/rtree/shared_test.go') diff --git a/internal/rtree/shared_test.go b/internal/rtree/shared_test.go index c435110..4810695 100644 --- a/internal/rtree/shared_test.go +++ b/internal/rtree/shared_test.go @@ -5,6 +5,7 @@ package rtree import ( "bytes" + "encoding/json" "errors" "fmt" "io" @@ -14,8 +15,6 @@ import ( "strings" "testing" - yaml "go.yaml.in/yaml/v3" - "github.com/majewsky/gofu/internal/cli" ) @@ -56,7 +55,7 @@ type Test struct { func (test Test) Run(t *testing.T) { //write index file, if any - IndexPath = filepath.Join(indexTmpDir, t.Name()+".yaml") + IndexPath = filepath.Join(indexTmpDir, t.Name()+".json") if test.Index.Repos != nil { err := test.Index.Write() if err != nil { @@ -94,7 +93,7 @@ func (test Test) Run(t *testing.T) { if test.ExpectIndex != nil { idx = test.ExpectIndex } - expectedIdxStr, err := yaml.Marshal(idx) + expectedIdxStr, err := json.MarshalIndent(idx, "", " ") if err != nil { t.Fatal(err.Error()) } -- cgit v1.3.1