From fcb84b26cbd6b8c30869cf1adb07fdc23a071dac Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 21 Oct 2019 11:49:03 +0200 Subject: updated the database name --- src/db.go | 2 +- src/go.mod | 5 +++++ src/go.sum | 4 ++++ src/structs.go | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/go.sum diff --git a/src/db.go b/src/db.go index e9b127c..f3ce53a 100644 --- a/src/db.go +++ b/src/db.go @@ -11,7 +11,7 @@ import ( // setup the Database func setupDatabase() *sql.DB { connStr := "user=postgres dbname=postgres sslmode=disable" - db, err := sql.Open("postgres", connStr) + db, err := sql.Open("postgresql", connStr) if err != nil { log.Fatal(err) } diff --git a/src/go.mod b/src/go.mod index fe3d2f1..863010d 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,3 +1,8 @@ module manager go 1.13 + +require ( + github.com/gorilla/mux v1.7.3 + github.com/lib/pq v1.2.0 +) diff --git a/src/go.sum b/src/go.sum new file mode 100644 index 0000000..a1951c2 --- /dev/null +++ b/src/go.sum @@ -0,0 +1,4 @@ +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= diff --git a/src/structs.go b/src/structs.go index c70ecb4..d7fcdcf 100644 --- a/src/structs.go +++ b/src/structs.go @@ -17,7 +17,7 @@ type Challenge struct { type StrippedChallenge struct { Name string `json:"name"` Description string `json:"description"` - FlagHash string `json:"flaghash"` + FlagHash string `json:"flag_hash"` Container string `json:"container"` Category string `json:"category"` Points int `json:"points"` -- cgit 1.4.1