Skip to content

Commit 16b2a63

Browse files
committed
Fix lock tests
1 parent 57121b8 commit 16b2a63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/projectfile/projectfile.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,8 @@ func AddLockInfo(projectFilePath, branch, version string) error {
11301130

11311131
projectRegex := regexp.MustCompile(fmt.Sprintf("(?m:(^project:\\s*%s))", ProjectURLRe))
11321132
lockString := fmt.Sprintf("%s@%s", branch, version)
1133-
lockUpdate := []byte(fmt.Sprintf(`${1}\nlock: %s`, lockString))
1133+
lockUpdate := fmt.Append(nil, `${1}`)
1134+
lockUpdate = append(lockUpdate, []byte(fmt.Sprintf("lock: %s", lockString))...)
11341135

11351136
data, err = os.ReadFile(projectFilePath)
11361137
if err != nil {

0 commit comments

Comments
 (0)