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 + 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")