From ccb24b7cc7e84961f8df8ba54b4267401cf158e3 Mon Sep 17 00:00:00 2001 From: zongz Date: Thu, 7 Nov 2024 14:45:53 +0800 Subject: [PATCH] fix: fix test case Signed-off-by: zongz --- pkg/downloader/toml.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/downloader/toml.go b/pkg/downloader/toml.go index abe37773..e42ec578 100644 --- a/pkg/downloader/toml.go +++ b/pkg/downloader/toml.go @@ -17,7 +17,7 @@ func (ps *ModSpec) MarshalTOML() string { var sb strings.Builder if ps != nil && len(ps.Version) != 0 && len(ps.Name) != 0 { if len(ps.Alias) == 0 { - sb.WriteString(ps.Version) + sb.WriteString(fmt.Sprintf("%q", ps.Version)) } else { sb.WriteString(fmt.Sprintf(SOURCE_PATTERN, fmt.Sprintf("package = %q, version = %q", ps.Name, ps.Version))) }