]> Cypherpunks repositories - gostls13.git/commit
internal/lazytemplate: add a lazy template wrapper
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 27 Feb 2019 22:02:51 +0000 (22:02 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 27 Feb 2019 23:49:01 +0000 (23:49 +0000)
commitbd23e84b73b90947a676ec9a5325de52d7186815
tree97b8d653bdc0368ada341c37ccf38708a5cbb89a
parent8e8abf368d5b8050f40408b23a4027824351f674
internal/lazytemplate: add a lazy template wrapper

Similar to internal/lazyregexp, this will allow removing unnecessary
work from init functions with trivial refactors, thanks to sync.Once.

Copy the structure. The only major difference is that a template also
carries a name.

For #29382.

Change-Id: I65d096dc2e2072b310bf59a814cd62669856b5b5
Reviewed-on: https://go-review.googlesource.com/c/164337
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/build/deps_test.go
src/internal/lazyregexp/lazyre.go
src/internal/lazytemplate/lazytemplate.go [new file with mode: 0644]