File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
15
15
- Changed underlying cobra command setup to return errors instead of calling ` os.Exit ` directly to enable simpler testing. ([ 454] ( https://github.com/cucumber/godog/pull/454 ) - [ mxygem] )
16
16
- Remove use of deprecated methods from ` _examples ` . ([ 460] ( https://github.com/cucumber/godog/pull/460 ) - [ ricardogarfe] )
17
17
18
+ ### Fixed
19
+
20
+ - Support for go1.18 in ` godog ` cli mode ([ 466] ( https://github.com/cucumber/godog/pull/466 ) - [ vearutop] )
21
+
18
22
## [ v0.12.4]
19
23
20
24
### Added
Original file line number Diff line number Diff line change @@ -205,6 +205,10 @@ func Build(bin string) error {
205
205
"-complete" ,
206
206
}
207
207
208
+ if err := filterImportCfg (compilerCfg ); err != nil {
209
+ return err
210
+ }
211
+
208
212
args = append (args , "-pack" , testmain )
209
213
cmd := exec .Command (compiler , args ... )
210
214
cmd .Env = os .Environ ()
@@ -234,6 +238,27 @@ func Build(bin string) error {
234
238
return nil
235
239
}
236
240
241
+ // filterImportCfg strips unsupported lines from imports configuration.
242
+ func filterImportCfg (path string ) error {
243
+ orig , err := os .ReadFile (path )
244
+ if err != nil {
245
+ return fmt .Errorf ("failed to read %s: %w" , path , err )
246
+ }
247
+
248
+ res := ""
249
+ for _ , l := range strings .Split (string (orig ), "\n " ) {
250
+ if ! strings .HasPrefix (l , "modinfo" ) {
251
+ res += l + "\n "
252
+ }
253
+ }
254
+ err = ioutil .WriteFile (path , []byte (res ), 0600 )
255
+ if err != nil {
256
+ return fmt .Errorf ("failed to write %s: %w" , path , err )
257
+ }
258
+
259
+ return nil
260
+ }
261
+
237
262
func maybeVendoredGodog () * build.Package {
238
263
dir , err := filepath .Abs ("." )
239
264
if err != nil {
You can’t perform that action at this time.
0 commit comments