File: unix2dos.go

package info (click to toggle)
golang-github-hashicorp-hcl 1.0.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, bullseye, bullseye-backports, experimental, forky, sid, trixie
  • size: 1,028 kB
  • sloc: makefile: 22
file content (15 lines) | stat: -rw-r--r-- 235 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package testhelper

import (
	"runtime"
	"strings"
)

// Converts the line endings when on Windows
func Unix2dos(unix string) string {
	if runtime.GOOS != "windows" {
		return unix
	}

	return strings.Replace(unix, "\n", "\r\n", -1)
}