From 538a353339f71d1290a04e6abb40c398bc745704 Mon Sep 17 00:00:00 2001 From: Vitor De Mario Date: Tue, 28 Aug 2018 11:38:47 -0300 Subject: [PATCH] Update README for Pop and Pop2 --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 64d8553..9c0232a 100644 --- a/README.md +++ b/README.md @@ -162,8 +162,17 @@ the given t Set. ```go func (s *Set) Pop() T ``` -Pop deletes and return an item from the Set. The underlying Set s is modified. -If Set is empty, nil is returned. +Pop deletes and returns an item from the Set. The underlying Set s is modified. +If Set is empty, the zero value is returned. + +#### func (*Set) Pop2 + +```go +func (s *Set) Pop2() (T, bool) +``` +Pop2 tries to delete and return an item from the Set. The underlying Set s is modified. +The second value is a bool that is true if the item existed in the set, and false if not. +If Set is empty, the zero value and false are returned. #### func (*Set) Remove