From 7c1e3776edd14848ae9435f0683476fc0d949439 Mon Sep 17 00:00:00 2001 From: Guilherme Salazar Date: Sun, 3 Mar 2024 21:29:58 -0300 Subject: [PATCH] chore: go fmt --- dot_test.go | 10 +++++----- main.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dot_test.go b/dot_test.go index c8be24a..6911be0 100644 --- a/dot_test.go +++ b/dot_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" "os" - "testing" "runtime" + "testing" ) func isSymlink(path string) bool { @@ -78,7 +78,7 @@ func TestDoCopy(t *testing.T) { m = FileMapping{ From: "fixtures/gpg-agent.conf.input", To: "out/gpg-agent.conf", - With: map[string]string { + With: map[string]string{ "PinentryPath": "/foo/bar", }, } @@ -365,11 +365,11 @@ func TestGetHomeDir(t *testing.T) { } func TestEvalTemplateString(t *testing.T) { - cases := map[string]string { + cases := map[string]string{ "{{ .v1 }}": "a value", "{{ .v2 }}": "", } - env := map[string]string { + env := map[string]string{ "v1": "a value", } for templ, want := range cases { @@ -386,7 +386,7 @@ func TestEvalTemplate(t *testing.T) { } else { otherOs = "darwin" } - with := map[string]string { + with := map[string]string{ "t1": "{{if eq .Os \"" + curOs + "\"}}it works{{end}}", "t2": "{{if eq .Os \"" + otherOs + "\"}}must not be this{{end}}", "t3": "{{if eq .Os \"" + otherOs + "\"}}must not be this{{else}}else{{end}}", diff --git a/main.go b/main.go index e7a1f7e..b648f1e 100644 --- a/main.go +++ b/main.go @@ -210,7 +210,7 @@ func (dots Dots) validate() []error { } if mapping.As != "copy" && len(mapping.With) > 0 { - errs = append(errs, fmt.Errorf("%s: templating is only supported in `copy` mode ]", mapping.From)); + errs = append(errs, fmt.Errorf("%s: templating is only supported in `copy` mode ]", mapping.From)) } } return errs @@ -240,7 +240,7 @@ func evalTemplateString(templStr string, env map[string]string) string { func evalTemplate(with map[string]string) map[string]string { newMap := make(map[string]string, len(with)) for variable, templ := range with { - env := map[string]string{ "Os": runtime.GOOS } + env := map[string]string{"Os": runtime.GOOS} newMap[variable] = evalTemplateString(templ, env) } return newMap