Skip to content

tls.Config: strict key check + remove data race #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2013
Merged

Conversation

julienschmidt
Copy link
Member

No description provided.

@ghost ghost assigned julienschmidt Jul 1, 2013
@@ -253,6 +213,78 @@ func scramblePassword(scramble, password []byte) []byte {
return scramble
}

// Returns the bool value of the input.
// The 2nd return type indicates if the input was a valid bool value
func readBool(input string) (value bool, valid bool) {
Copy link
Member

Choose a reason for hiding this comment

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

bool, error instead of bool, bool as return value to get rid of some duplication?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, then we'd have to compare with the err in some cases which I'd like to avoid.

// Returns the bool value of the input.
// The 2nd return value indicates if the input was a valid bool value
func readBool(input string) (value bool, valid bool) {
switch input {
Copy link
Member

Choose a reason for hiding this comment

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

switch strings.ToLower(input)...?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that this is necessary. I wouldn't consider "trUE" etc. as a valid bool formatting, neither does Go's stdlib. Also the current way is more efficient.

@arnehormann
Copy link
Member

LGTM though I'd love to have my latest comment addressed (convert if-chain to switch)

julienschmidt added a commit that referenced this pull request Jul 1, 2013
tls.Config: strict key check + remove data race
@julienschmidt julienschmidt merged commit 2f1342a into master Jul 1, 2013
@julienschmidt julienschmidt deleted the tls branch July 1, 2013 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants