From 6a1787ed161ec7345ef4a6cdc34df88e3ae5e611 Mon Sep 17 00:00:00 2001 From: Paul Aldridge Date: Tue, 24 May 2022 11:01:12 +0100 Subject: [PATCH] osv: removed trailing dot in file path Trailing dots in file paths can interefere with go.mod. Fixes: #619 Signed-off-by: Paul Aldridge --- updater/osv/osv_test.go | 3 +++ updater/osv/s3_test.go | 2 +- updater/osv/testdata/{list.xml. => list.xml} | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename updater/osv/testdata/{list.xml. => list.xml} (100%) diff --git a/updater/osv/osv_test.go b/updater/osv/osv_test.go index f1e142ac9..6504d3cb8 100644 --- a/updater/osv/osv_test.go +++ b/updater/osv/osv_test.go @@ -56,6 +56,9 @@ func (a *apiStub) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch { case p == "/": p = "list.xml." + r.URL.Query().Get(`continuation-token`) + if p == "list.xml." { + p = "list.xml" + } f, err := sys.Open(p) if err != nil { a.Error(err) diff --git a/updater/osv/s3_test.go b/updater/osv/s3_test.go index 8535ecad5..9ccdb21cb 100644 --- a/updater/osv/s3_test.go +++ b/updater/osv/s3_test.go @@ -7,7 +7,7 @@ import ( ) func TestXML(t *testing.T) { - f, err := os.Open("testdata/list.xml.") + f, err := os.Open("testdata/list.xml") if err != nil { t.Fatal(err) } diff --git a/updater/osv/testdata/list.xml. b/updater/osv/testdata/list.xml similarity index 100% rename from updater/osv/testdata/list.xml. rename to updater/osv/testdata/list.xml