Skip to content

Instantly share code, notes, and snippets.

@ma6174
Created November 12, 2015 03:01
Show Gist options
  • Save ma6174/b628777b638c9a9234db to your computer and use it in GitHub Desktop.
Save ma6174/b628777b638c9a9234db to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"labix.org/v2/mgo/bson"
)
func main() {
fmt.Println(bson.ObjectId("000000000000"))
fmt.Println(bson.ObjectIdHex("000000000000000000000000"))
fmt.Println(bson.ObjectId("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"))
}
@ma6174
Copy link
Author

ma6174 commented Nov 12, 2015

output:

ObjectIdHex("303030303030303030303030")
ObjectIdHex("000000000000000000000000")
ObjectIdHex("000000000000000000000000")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment