Playspace for golang experiments, code snippets and personal scrappy tooling. Each idea can:
- Turn into bigger projects that started off as a single
main.go
file in a directory undercmd
and keep expanding until this code structure makes navigation and usage difficult. Then, the code is moved to a dedicated repository. - Stick around as a reference to be used in other projects.
-
boilerplate with authn
-
simple lists server and templates
-
gorm boilerplate with form parsing and validation
-
html templates
- https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/html-templates
- with file embed: https://charly3pins.dev/blog/learn-how-to-use-the-embed-package-in-go-by-building-a-web-page-easily/
- https://www.calhoun.io/intro-to-templates-p2-actions/
- https://www.calhoun.io/intro-to-templates-p3-functions/
-
struct validation
- https://thedevelopercafe.com/articles/payload-validation-in-go-with-validator-626594a58cf6
- https://pkg.go.dev/github.com/go-playground/validator/v10#section-readme
- in fiber framework: https://dev.to/franciscomendes10866/how-to-validate-data-in-golang-1f87
- iso dates with ech framework: https://rickyanto.com/how-to-create-custom-validator-for-iso8601-date-with-go-validator-from-go-playground-and-echo-framework/
-
HTTP forms parsing lib: https://github.com/go-playground/form
-
html charts
-
lintint
-
interactive map layout:
- Mapbox GL JS:
- OpenLayers
- D3.js
- https://deck.gl/
- https://www.react-simple-maps.io/
- https://leafletjs.com/examples/choropleth/
- Datamaps
- Polymaps
- svgMap
- https://github.com/mmarcon/jhere
- https://developers.google.com/chart/interactive/docs/gallery/geochart
- https://openlayers.org/doc/quickstart.html
go run github.com/raokrutarth/golang-playspace/cmd/ct-prototype -add-user
docker exec -it gops-dev-db env
psql -c "\dS public.*"
psql -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
psql -c "TRUNCATE TABLE range_transactions, expanded_transactions CASCADE;"
psql -c "select * from range_transactions"