]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add $DOLLAR to the predefined variables for go generate
authorRob Pike <r@golang.org>
Wed, 25 Mar 2015 20:17:54 +0000 (13:17 -0700)
committerRob Pike <r@golang.org>
Thu, 26 Mar 2015 00:18:51 +0000 (00:18 +0000)
commitf338d942857333917af7220cd53910e3a2ad16b9
treebffa009e2d1ed087830ea1f138a60b706adebc94
parente2543ef62c98b2ce07a54698e6a8293f380a1128
cmd/go: add $DOLLAR to the predefined variables for go generate

Without some hook like this, it's impossible to get a $ into the generate
command, which is necessary if you're trying to do some shell scripting
or regular expressions.

We could use backslash escaping but that's already tricky enough
because the strings are processed as Go strings. Using $ like this
means we need no more mechanism, just a predefined variable.

We may need to revisit this but I hope we can avoid new quoting rules.

Change-Id: Ieb478c8cc767a866765282472239ed3c1e5669a8
Reviewed-on: https://go-review.googlesource.com/8091
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/generate.go
src/cmd/go/generate_test.go