From 44441cc11ef30ba2a072c73b7062cd21db9923af Mon Sep 17 00:00:00 2001 From: Miguel Victoria Date: Sun, 6 Oct 2024 00:12:24 +0200 Subject: [PATCH] Handle paths with and without trailing / --- misc/stdlib_diff/report.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/stdlib_diff/report.go b/misc/stdlib_diff/report.go index b193de11f35..9ae5a63be53 100644 --- a/misc/stdlib_diff/report.go +++ b/misc/stdlib_diff/report.go @@ -66,9 +66,10 @@ func NewReportBuilder(srcPath, dstPath, outDir string, srcIsGno bool) (*ReportBu } return &ReportBuilder{ - SrcPath: srcPath, - DstPath: dstPath, - OutDir: outDir, + // Trim suffix / in order to standardize paths accept path with or without `/` + SrcPath: strings.TrimSuffix(srcPath, `/`), + DstPath: strings.TrimSuffix(dstPath, `/`), + OutDir: strings.TrimSuffix(outDir, `/`), SrcIsGno: srcIsGno, packageTemplate: packageTemplate, indexTemplate: indexTemplate,