commit | e48c958d0748f019f963fb647e5894d630759901 | [log] [tgz] |
---|---|---|
author | Vadim Shtayura <vadimsh@chromium.org> | Mon Feb 04 22:43:50 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Feb 04 22:43:50 2019 |
tree | 67d13a794e953842657918477fd94a8ea0a06011 | |
parent | 5c20364d21634ea329d62976efc4a2923d88eba4 [diff] |
[lucicfg] Make var.get() auto-initialize the variable to the supplied default. It means once var.get() is called for the first time, all subsequent calls will observe the exact same value (either an explicitly set one or the default). This is a measure to reduce "statefullness" of vars, meant to outlaw the following case: lib.do_something() # does something based on lib.var default value lib.var.set(123) lib.do_something() # suddenly does something else, since lib.var is set now Now lib.var.set(...) call will fail with a message explaining that it was auto-initialized as a side effect of first 'get'. R=iannucci@chromium.org, tandrii@chromium.org BUG=833946 Change-Id: I0efb87cc0833d3e74ac9e19741b27f83ea166476 Reviewed-on: https://chromium-review.googlesource.com/c/1453018 Commit-Queue: Vadim Shtayura <vadimsh@chromium.org> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
LUCI Go code is meant to be worked on from an Chromium infra.git checkout, which enforces packages versions and Go toolchain version. First get fetch via depot_tools.git then run:
fetch infra cd infra/go eval `./env.py` cd src/go.chromium.org/luci
Contributing uses the same flow as Chromium contributions.