OK, I just found this: https://github.com/golang/go/issues/44976 It looks the language version is indeed defaulted to 1.16.
On Thursday, August 12, 2021 at 12:36:37 AM UTC-4 tapi...@gmail.com wrote: > On Thursday, August 12, 2021 at 12:22:08 AM UTC-4 Ian Lance Taylor wrote: > >> On Wed, Aug 11, 2021 at 9:16 PM tapi...@gmail.com <tapi...@gmail.com> >> wrote: >> > >> > On Thursday, August 12, 2021 at 12:12:13 AM UTC-4 Ian Lance Taylor >> wrote: >> >> >> >> On Wed, Aug 11, 2021 at 5:44 PM tapi...@gmail.com <tapi...@gmail.com> >> wrote: >> >> > >> >> > But by not specifying the language version in go.mod, I think most >> people would expect to use the latest features. >> >> > In other words, the default language version gc uses should be the >> same as the version of the toolchain containing gc. >> >> >> >> I believe it is. If I run "go mod init" then in the result go.mod >> >> file I see the current language version. >> > >> > >> > My project was created long before. There is not the "go" directive in >> go.mod. >> > >> > Does it mean I must run "go mod tidy" before run other go commands >> since Go 1.17? >> >> You will need to edit the "go" line in your go.mod file to your >> desired language version, or run "go mod edit -go=1.17". Running "go >> mod tidy" will not change the language version in your go.mod file, >> nor should it. >> >> Ian >> > > But "go mod tidy" will add the "go 1.17" line if the directive line > doesn't exist there. It will help. > > Ian, I still don't understand why gc doesn't think the language version is > go1.17 if the directive is missing. > It looks, without this line, Go 1.14 introduced overlapping interface > embedding code compiles okay. > So gc 1.17rc2 must use a language version in [1.14, 1.17). > > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e5d13236-8fa3-45d7-8cc1-e6d3044938abn%40googlegroups.com.