Skip to content

Conversation

@FeNoMeNa
Copy link

This change allows using of any type that implements fmt.Stringer in ObjectIdHex and IsObjectIdHex functions.

Example:

If we have type type UserId string, we have to typecast UserId to string.
With this change we simply pass the UserId object without typecast.

@fatih
Copy link

fatih commented Jul 24, 2014

I don't believe that would work. You need to implement the String() method for every type you want to pass to make use of the Stringer interface. That means now it's not possible to pass a simple string type anymore :) http://play.golang.org/p/myVcRtnc_A

I suggest to revisit this PR or even close it.

@niemeyer niemeyer closed this Jul 24, 2014
@niemeyer
Copy link
Contributor

@fatih is spot on.

wpjunior pushed a commit to wpjunior/mgo that referenced this pull request Aug 12, 2018
* Add 3.6 user authenticationRestrictions

* Add struct-field comment

* Add struct-field comment go-mgo#2

* Add struct-field comment go-mgo#3

* Add documentation link

* Fix comment

* Fix comment go-mgo#2

* add to README.md

* add to README.md go-mgo#2

* add to README.md go-mgo#3

* Add positive/negative authentication restrictions user test

* Use denyUser for negative test

* Correct message

* Fix error match

* Fix close on nil/closed session

* Simplify test, last change :)

* Simplify test, last change :) go-mgo#2

* Simplify test, last change :) go-mgo#3

* Fix := error
wpjunior pushed a commit to wpjunior/mgo that referenced this pull request Aug 12, 2018
wpjunior pushed a commit to wpjunior/mgo that referenced this pull request Aug 12, 2018
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