"go1.15 mod tidy" fails if the current project depends on a module containing a file using embed and guarded by "+build go1.16"

171 views
Skip to first unread message

tapi...@gmail.com

unread,
Feb 18, 2021, 4:03:50 AM2/18/21
to golang-nuts
Does this mean the "+build go1.N" directive is only intended to cooperate with Go toolchain 1.N+? 

tapi...@gmail.com

unread,
Feb 18, 2021, 4:06:19 AM2/18/21
to golang-nuts
BTW, "go1.15 build" succeeds.

Ian Lance Taylor

unread,
Feb 18, 2021, 9:28:53 AM2/18/21
to tapi...@gmail.com, golang-nuts
See the discussion at https://golang.org/issue/43980.

Ian

tapi...@gmail.com

unread,
Feb 18, 2021, 6:29:00 PM2/18/21
to golang-nuts
Thanks for the link.
So "go mod tidy" ignores build tags, and this is intended?

Ian Lance Taylor

unread,
Feb 18, 2021, 9:23:45 PM2/18/21
to tapi...@gmail.com, golang-nuts
On Thu, Feb 18, 2021 at 3:29 PM tapi...@gmail.com <tapi...@gmail.com> wrote:
>
> Thanks for the link.
> So "go mod tidy" ignores build tags, and this is intended?

That is my understanding, yes.

Ian


> On Thursday, February 18, 2021 at 9:28:53 AM UTC-5 Ian Lance Taylor wrote:
>>
>> On Thu, Feb 18, 2021 at 1:06 AM tapi...@gmail.com <tapi...@gmail.com> wrote:
>> >
>> > BTW, "go1.15 build" succeeds.
>> >
>> > On Thursday, February 18, 2021 at 4:03:50 AM UTC-5 tapi...@gmail.com wrote:
>> >>
>> >> Does this mean the "+build go1.N" directive is only intended to cooperate with Go toolchain 1.N+?
>>
>>
>> See the discussion at https://golang.org/issue/43980.
>>
>> Ian
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9a4eb260-d5de-4a7d-89e3-e26a9ff41455n%40googlegroups.com.

Amnon

unread,
Feb 19, 2021, 7:20:36 AM2/19/21
to golang-nuts
go mod tidy has to ignore build tags.

Because if it did not ignore build tags, it would delete dependencies needed by other platforms.

tapi...@gmail.com

unread,
Feb 20, 2021, 5:31:06 AM2/20/21
to golang-nuts
reasonable. Thanks both for explanations.
Reply all
Reply to author
Forward
0 new messages