Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Issue 2833073004: environ: Fix key case, add GetEmpty and Remove. (Closed)

Created:
3 years, 8 months ago by dnj
Modified:
3 years, 8 months ago
Reviewers:
Vadim Sh., iannucci
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, maruel+w_chromium.org, tandrii+luci-go_chromium.org
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

environ: Fix key case, add GetEmpty and Remove. The "environ" package does not ignore the case of enviornment variable keys on Windows. This patch fixes this bug by allowing an Env to be configured to be case insensitive, and having Windows systems default to "true". Creation methods "System" and "New" will both default to the case sensitivity of the current operating system. Additionally, this patch adds Remove, which allows for the deletion of enviornment variables, and GetEmpty, which offers an interface similar to "os.Getenv". BUG=chromium:714165 TEST=unit Review-Url: https://codereview.chromium.org/2833073004 Committed: https://github.com/luci/luci-go/commit/fde97cf33c7fad766b10ad40b5cbc10830d5749f

Patch Set 1 #

Patch Set 2 : simplify and test map #

Patch Set 3 : reintroduce split function, but cleaner #

Patch Set 4 : better comment #

Patch Set 5 : add case sensitivity support #

Patch Set 6 : better doc #

Patch Set 7 : cleanup, consistency, comments, clone fix #

Patch Set 8 : fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+263 lines, -88 lines) Patch
M common/system/environ/environment.go View 1 2 3 4 5 6 5 chunks +133 lines, -43 lines 0 comments Download
M common/system/environ/environment_test.go View 1 2 3 4 5 6 7 5 chunks +130 lines, -45 lines 0 comments Download

Messages

Total messages: 18 (9 generated)
dnj
*sigh* PTAL
3 years, 8 months ago (2017-04-21 15:45:33 UTC) #2
Vadim Sh.
On Linux and OSX the environment is case sensitive, on Windows - it's not. Search ...
3 years, 8 months ago (2017-04-21 16:39:07 UTC) #3
dnj
On 2017/04/21 16:39:07, Vadim Sh. wrote: > On Linux and OSX the environment is case ...
3 years, 8 months ago (2017-04-21 16:49:30 UTC) #4
dnj
PTAL, updated to be OS-aware.
3 years, 8 months ago (2017-04-21 17:39:01 UTC) #6
Vadim Sh.
lgtm
3 years, 8 months ago (2017-04-21 17:43:26 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2833073004/120001
3 years, 8 months ago (2017-04-21 18:07:10 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: Luci-go Win Tester on luci.infra.try (JOB_FAILED, https://luci-milo.appspot.com/swarming/task/35aa891d20ab7c10)
3 years, 8 months ago (2017-04-21 18:19:40 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2833073004/140001
3 years, 8 months ago (2017-04-21 18:36:25 UTC) #15
commit-bot: I haz the power
3 years, 8 months ago (2017-04-21 18:52:00 UTC) #18
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://github.com/luci/luci-go/commit/fde97cf33c7fad766b10ad40b5cbc10830d5749f

Powered by Google App Engine
This is Rietveld 408576698