func getCollection() *mgo.Collection { if collection == nil { collection = lib.GetDatabaseHandle().C("people") } return collection }
func main() { lib.GetDatabaseHandle() log.Print("Registering webserver routes") /* Routing */ http.Handle("/", http.FileServer(http.Dir("public/"))) log.Printf("Starting webserver on port %s", port) err := http.ListenAndServe(port, nil) if err != nil { log.Fatal("Error listening: ", err) } }