From a2be9eec53f5f9d6a7c60f30e82f792f98c5c259 Mon Sep 17 00:00:00 2001 From: Oleksandr Slynko Date: Sun, 7 Jun 2020 22:59:25 +0100 Subject: [PATCH] Import package without dot Fixes #683 --- ginkgo/generate_command.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ginkgo/generate_command.go b/ginkgo/generate_command.go index c0a39237e..4099f99a8 100644 --- a/ginkgo/generate_command.go +++ b/ginkgo/generate_command.go @@ -39,7 +39,7 @@ import ( {{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}} {{if .IncludeImports}}. "github.com/onsi/gomega"{{end}} - {{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}} + {{if .ImportPackage}}"{{.PackageImportPath}}"{{end}} ) var _ = Describe("{{.Subject}}", func() { @@ -55,7 +55,7 @@ import ( "github.com/sclevine/agouti" . "github.com/sclevine/agouti/matchers" - {{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}} + {{if .ImportPackage}}"{{.PackageImportPath}}"{{end}} ) var _ = Describe("{{.Subject}}", func() { @@ -78,7 +78,7 @@ type specData struct { Subject string PackageImportPath string IncludeImports bool - DotImportPackage bool + ImportPackage bool } func generateSpec(args []string, agouti, noDot, internal bool) { @@ -119,7 +119,7 @@ func generateSpecForSubject(subject string, agouti, noDot, internal bool) error Subject: formattedName, PackageImportPath: getPackageImportPath(), IncludeImports: !noDot, - DotImportPackage: !internal, + ImportPackage: !internal, } targetFile := fmt.Sprintf("%s_test.go", specFilePrefix)