Skip to content
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

Fix golint errors in lib/selector #430

Merged
merged 2 commits into from
Jun 10, 2017

Conversation

xychu
Copy link
Contributor

@xychu xychu commented May 29, 2017

Not sure if this is the right time to do the golint checks. :-)

Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up this code!

I've made a few minor comments on some typos. Worth @fasaxc having a quick look through as he knows this bit of code better than I do.

String() string
UniqueId() string
// String returns the unique ID that represents this selector.
Copy link
Member

Choose a reason for hiding this comment

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

String -> UniqueID

type LabelInSetNode struct {
LabelName string
Value StringSet
}

// Evaluate return true if the labels' value in the set of current LabelInSetNode
Copy link
Member

Choose a reason for hiding this comment

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

typo: return -> returns

type LabelNotInSetNode struct {
LabelName string
Value StringSet
}

// Evaluate return true if the labels' value not in the set of current LabelNotInSetNode
Copy link
Member

Choose a reason for hiding this comment

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

return -> returns

type LabelNeValueNode struct {
LabelName string
Value string
}

// Evaluate return true if the labels' value not equal to the value of current LabelNeValueNode
Copy link
Member

Choose a reason for hiding this comment

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

return -> returns

type HasNode struct {
LabelName string
}

// Evaluate return true if the labels has the LabelName of current HasNode
Copy link
Member

Choose a reason for hiding this comment

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

return -> returns (and a few more through the PR)

@@ -49,6 +51,7 @@ func (ss StringSet) Contains(s string) bool {
return ss[minIdx] == s
}

// ConvertToStringSetInPlace convert a string slice into StringSet in place
Copy link
Member

Choose a reason for hiding this comment

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

convert -> converts

@@ -70,6 +88,7 @@ var (
inRegex = regexp.MustCompile("^" + inExpr)
)

// Tokenize transform input string to tokens
Copy link
Member

Choose a reason for hiding this comment

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

transform -> transforms

@xychu xychu force-pushed the label-selector branch 3 times, most recently from b1e5b7b to b56deb6 Compare June 1, 2017 03:10
@fasaxc
Copy link
Member

fasaxc commented Jun 7, 2017

@xychu You code cleanups/name fixes look good to me but a lot of the comments are of the form:

// DoX does X
func DoX(...)

I'd prefer to have no comment in that case since the comment doesn't add very much. What do you think?

@xychu
Copy link
Contributor Author

xychu commented Jun 8, 2017

@fasaxc sure, will update it later.

@xychu
Copy link
Contributor Author

xychu commented Jun 10, 2017

@fasaxc @caseydavenport plz review again.

@caseydavenport caseydavenport merged commit 6dbd98f into projectcalico:master Jun 10, 2017
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.

3 participants