@@ -129,7 +129,7 @@ func Build(bin string) error {
129
129
130
130
// make sure godog package archive is installed, gherkin
131
131
// will be installed as dependency of godog
132
- cmd := exec .Command ("go" , "install" , godogPkg .ImportPath )
132
+ cmd := exec .Command ("go" , "install" , "-i" , godogPkg .ImportPath )
133
133
cmd .Env = os .Environ ()
134
134
out , err := cmd .CombinedOutput ()
135
135
if err != nil {
@@ -196,6 +196,26 @@ func Build(bin string) error {
196
196
cmd = exec .Command (linker , args ... )
197
197
cmd .Env = os .Environ ()
198
198
199
+ // in case if build is without contexts, need to remove import maps
200
+ if testdir == workdir {
201
+ data , err := ioutil .ReadFile (cfg )
202
+ if err != nil {
203
+ return err
204
+ }
205
+
206
+ lines := strings .Split (string (data ), "\n " )
207
+ var fixed []string
208
+ for _ , line := range lines {
209
+ if strings .Index (line , "importmap" ) == 0 {
210
+ continue
211
+ }
212
+ fixed = append (fixed , line )
213
+ }
214
+ if err := ioutil .WriteFile (cfg , []byte (strings .Join (fixed , "\n " )), 0600 ); err != nil {
215
+ return err
216
+ }
217
+ }
218
+
199
219
out , err = cmd .CombinedOutput ()
200
220
if err != nil {
201
221
msg := `failed to link test executable:
0 commit comments