Skip to content

Commit

Permalink
Move gob Register functions to pokerogue-server.go
Browse files Browse the repository at this point in the history
  • Loading branch information
patapancakes committed Apr 18, 2024
1 parent dbcc0d0 commit 9f1349d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions api/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package api

import (
"encoding/base64"
"encoding/gob"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -32,9 +31,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
s.Exit.RLock()
defer s.Exit.RUnlock()

gob.Register([]interface{}{})
gob.Register(map[string]interface{}{})

if s.Debug {
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
Expand Down
6 changes: 6 additions & 0 deletions pokerogue-server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"encoding/gob"
"flag"
"log"
"net"
Expand Down Expand Up @@ -29,6 +30,11 @@ func main() {

flag.Parse()


// register gob types
gob.Register([]interface{}{})
gob.Register(map[string]interface{}{})

// get database connection
err := db.Init(*dbuser, *dbpass, *dbproto, *dbaddr, *dbname)
if err != nil {
Expand Down

0 comments on commit 9f1349d

Please sign in to comment.