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

Support any type that implements fmt.Stringer in ObjectIdHex and IsObjectIdHex instead of simple string #2

Closed
wants to merge 1 commit into from

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
jameinel added a commit to jameinel/mgo that referenced this pull request Nov 13, 2018
Bring in the patches that Juju had in its patches/ directory.
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