summaryrefslogtreecommitdiff
path: root/src/go/build/constraint/expr_test.go
Commit message (Collapse)AuthorAgeFilesLines
* go/build/constraint: fix parsing of "// +build" (with no args)Russ Cox2021-05-181-14/+18
| | | | | | | | | | | | | | "// +build" by itself was like "// +build !" - unsatisfiable. Make it so again (right now it panics). Fixes #44487. Change-Id: Iacbc1398af6f988ef011f9f438e792eb62f8f434 Reviewed-on: https://go-review.googlesource.com/c/go/+/320829 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
* go/build/constraint: add parser for build tag constraint expressionsRuss Cox2021-01-081-0/+317
This package implements a parser for the new //go:build constraint lines. The parser also handles // +build lines, to be able to process legacy files. This will not be used in the standard library until Go 1.17, but it seems worth publishing in Go 1.16 so that code that needs to process both kinds of lines once Go 1.17 comes out will be able to build using Go 1.16 as well. For #41184. Design in https://golang.org/design/draft-gobuild. Change-Id: I756c0de4081c5039e8b7397200e5274f223ab111 Reviewed-on: https://go-review.googlesource.com/c/go/+/240604 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Russ Cox <rsc@golang.org> Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>