Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: support truthy values in boolean unit options #1574

Merged
merged 1 commit into from
May 19, 2016

Conversation

dongsupark
Copy link
Contributor

Support truthy values in boolean unit options(true, yes, on, 1, t).

Originally written by @wuqixuan
Supersedes #1271
Fixes: #1108


// isTruthyValue returns true if a given string is any of "truthy" value,
// i.e. "true", "yes", "1", "on", or "t".
func isTruthyValue(astr string) bool {
Copy link
Contributor

@jonboulle jonboulle May 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test table for this function please? (I know it seems incredibly simplistic but stranger places have tripped us up before)
also s/astr/s/, prefer simpler variable names in go

Support truthy values in boolean unit options(true, yes, on, 1, t).

Originally written by wuqixuan <wuqixuan@huawei.com>
Supersedes coreos#1271
Fixes: coreos#1108
@jonboulle
Copy link
Contributor

LGTM

@dongsupark
Copy link
Contributor Author

Done.

  • Added a new unit test TestUnitIsTruthy.
  • Renamed astr to s.

@dongsupark dongsupark merged commit 77dd54e into coreos:master May 19, 2016
@dongsupark
Copy link
Contributor Author

Merged #1574. Thanks.

@dongsupark dongsupark deleted the dongsu/fleetctl-truthy-values branch May 19, 2016 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants