From 51cdc4026f4312f650a9942e82d408949f1afe06 Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 23 Sep 2025 09:13:46 -0700 Subject: [PATCH 1/2] run tests on every pr and after merges --- .github/workflows/go-test.yml | 21 +++++++++++++++++++++ .gitignore | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/go-test.yml diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 0000000..74be6fa --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,21 @@ +name: Go Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.x' + + - name: Test + run: go test ./... diff --git a/.gitignore b/.gitignore index f6ddc29..234dd5e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ go.work.sum .vscode/ *.~ +# Database files +api/*.db + From 74ab437cba7be76ce6a4d9af01969f4348f48b5b Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 23 Sep 2025 09:25:39 -0700 Subject: [PATCH 2/2] fixup --- api/contest.go | 1 - api/user.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/api/contest.go b/api/contest.go index 9f59da3..e0066ab 100644 --- a/api/contest.go +++ b/api/contest.go @@ -3,7 +3,6 @@ package api import ( "database/sql" "encoding/json" - "fmt" "log" "net/http" ) diff --git a/api/user.go b/api/user.go index aae7d8e..0803c0c 100644 --- a/api/user.go +++ b/api/user.go @@ -46,7 +46,7 @@ func (api *ApiContext) createUser(w http.ResponseWriter, r *http.Request) { // Obtener el ID del usuario reciƩn insertado if id, err := res.LastInsertId(); err == nil { - new_user.User_ID = int(id) + new_user.UserID = int(id) } w.Header().Set("Content-Type", "application/json")