<p dir="auto">by <strong><a href="mailto:raul.san@sent.com">raul.san@sent.com</a></strong>:</p>
<pre class="notranslate">The tags are not read if they are just before of package sentence.

$ cat email_test.go
// +build email
package valid

import "testing"

func TestEmail(t *testing.T) {}

$ cat a_test.go
// +build !email
package valid

import "testing"

func TestA(t *testing.T) {}

$ cat b_test.go
// +build !email
package valid

import "testing"

func TestB(t *testing.T) {}


$ go test -v
=== RUN TestA
--- PASS: TestA (0.00 seconds)
=== RUN TestB
--- PASS: TestB (0.00 seconds)
=== RUN TestEmail
--- PASS: TestEmail (0.00 seconds)
PASS

$ go test -v -tags email
=== RUN TestA
--- PASS: TestA (0.00 seconds)
=== RUN TestB
--- PASS: TestB (0.00 seconds)
=== RUN TestEmail
--- PASS: TestEmail (0.00 seconds)
PASS

* * *

This works:

$ cat email_test.go
// +build email

package valid

import "testing"

func TestEmail(t *testing.T) {}

$ cat a_test.go
// +build !email

package valid

import "testing"

func TestA(t *testing.T) {}

$ cat b_test.go
// +build !email

package valid

import "testing"

func TestB(t *testing.T) {}


$ go test -v
=== RUN TestA
--- PASS: TestA (0.00 seconds)
=== RUN TestB
--- PASS: TestB (0.00 seconds)
PASS

$ go test -v -tags email
=== RUN TestEmail
--- PASS: TestEmail (0.00 seconds)
PASS</pre>
<p dir="auto">This issue proposes that Go should support some form of generic programming.<br>
It has the Go2 label, since for Go1.x the language is more or less done.</p>
<p dir="auto">Accompanying this issue is <a href="https://github.com/golang/proposal/blob/master/design/15292-generics.md">a general generics proposal</a> by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ianlancetaylor/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ianlancetaylor">@ianlancetaylor</a> that includes four specific flawed proposals of generic programming mechanisms for Go.</p>
<p dir="auto">The intent is not to add generics to Go at this time, but rather to show people what a complete proposal would look like. We hope this will be of help to anyone proposing similar language changes in the future.</p>