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

Conversation

@dongsupark
Copy link

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

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

job/job.go Outdated

// 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 <[email protected]>
Supersedes coreos#1271
Fixes: coreos#1108
@jonboulle
Copy link
Contributor

LGTM

@dongsupark
Copy link
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
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