Skip to content

🦍 Simple API to learn Go's net/http + gorilla/mux

Notifications You must be signed in to change notification settings

jlram/go-mux-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a personal project I started to improve my Go skills in a backend sense, including:

It firstly consists in a product CRUD application, but would like to do expand it in the future (here)

Testing

Run test instance of postgreSQL

docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=openpgpwd -d postgres

Run tests

cd src && go test -v

Output should be like this:

=== RUN   TestEmptyTable
--- PASS: TestEmptyTable (0.00s)
=== RUN   TestNonExistentProduct
--- PASS: TestNonExistentProduct (0.00s)
=== RUN   TestCreateProduct
--- PASS: TestCreateProduct (0.00s)
=== RUN   TestRetrieveProduct
--- PASS: TestRetrieveProduct (0.00s)
=== RUN   TestUpdateProduct
--- PASS: TestUpdateProduct (0.00s)
--- FAIL: TestUpdateProduct (0.00s)
=== RUN   TestDeleteProduct
--- PASS: TestDeleteProduct (0.00s)
PASS

Running

Option 1: Run project

cd src && go run .

Option 2: Alternatively, generate executable file

cd src && go build, then run /src/src.exe

About

🦍 Simple API to learn Go's net/http + gorilla/mux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages