go-todo

module
v0.0.0-...-1c8987f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2025 License: MIT

README

go-todo

Actions Status PkgGoDev

A standard-library focused Go JSON API server example with PostgreSQL persistence, full CRUD, authentication, and test coverage.

Install

go get github.com/bcomnes/go-todo

Development

This project requires a local PostgreSQL database.

Running Tests

Unit tests run by default:

make test

Integration (PostgreSQL) tests are skipped unless explicitly enabled:

make test TEST_FLAGS='-args -db'

Or manually:

go test ./... -args -db
Migrations
make migrate-up
make migrate-down
Environment Variables

The server and tests rely on the following environment variables (can be set in a .env file):

DATABASE_URL=postgres://postgres@localhost/go-todo?sslmode=disable
PORT=8080
HOST=0.0.0.0

Usage

package main

import (
  "fmt"
  "github.com/bcomnes/go-todo"
)

func main() {
  fmt.Println("hello world")
}

See more examples on PkgGoDev.

API

See API docs on PkgGoDev.

License

MIT

Directories

Path Synopsis
cmd
server command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL