]> Cypherpunks repositories - gostls13.git/commit
go/build/constraint: add parser for build tag constraint expressions
authorRuss Cox <rsc@golang.org>
Mon, 22 Jun 2020 17:06:40 +0000 (13:06 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 8 Jan 2021 17:08:44 +0000 (17:08 +0000)
commite65c543f3c34f4a505c37ebc3c2b608bc8ae83ec
tree0b817184b7e013641929b657e0781d6d5934a8b1
parent0c5afc4fb7e3349ec4efdce6554f83554e3d087c
go/build/constraint: add parser for build tag constraint expressions

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>
src/go/build/build_test.go
src/go/build/constraint/expr.go [new file with mode: 0644]
src/go/build/constraint/expr_test.go [new file with mode: 0644]
src/go/build/deps_test.go