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 #33 #34

Merged
merged 1 commit into from
Feb 8, 2020
Merged

Fix golint #33 #34

merged 1 commit into from
Feb 8, 2020

Conversation

u5surf
Copy link
Contributor

@u5surf u5surf commented Jan 18, 2020

Fixes #33
I fixed all golint warnings. Almost I fixed the comment of expose items.
it might be misunderstanding those exposed func, var...

iterator.go Outdated
@@ -4,6 +4,7 @@

package rbtree

// Iterator is the function of iteration entity
Copy link
Owner

Choose a reason for hiding this comment

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

we may add a sample to help people to understand the Iterator type, how about

// Iterator is the function of iteration entity which would be 
// used by those functions like `Ascend`, `Dscend`, etc.
//
// A typical Iterator with Print :
// func loop_with_print(item rbtree.Item) bool {
//         i, ok := item.(XXX)
//         if !ok {
//                 return false
//         }
//         fmt.Printf("%+v\n", i)
//         return true
// }

rbtree.go Outdated
RED = 0
// RED represents the color of the node is red
RED = 0
// BLACK represents the color of the node is brack
Copy link
Owner

Choose a reason for hiding this comment

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

typo :) brack

rbtree.go Outdated
BLACK = 1
)

// Item has a method to compare its which is less
Copy link
Owner

Choose a reason for hiding this comment

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

typo?

stats.go Outdated
@@ -41,6 +43,7 @@ func (t *Rbtree) Delete(item Item) Item {
return t.delete(&Node{t.NIL, t.NIL, t.NIL, RED, item}).Item
}

//Get search the node which includes its node
Copy link
Owner

Choose a reason for hiding this comment

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

how about something like

// Get search for the specified item (which was carried by a Node)  in the tree, return nil if not found.

@HuKeping
Copy link
Owner

HuKeping commented Jan 21, 2020

Could you please add your sign-off , the rest LGTM.

Signed-off-by: u5surf <[email protected]>

@HuKeping HuKeping merged commit 29f0b79 into HuKeping:master Feb 8, 2020
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.

Fix golint warning
2 participants