Skip to content

Commit 93d106b

Browse files
chore: move migrations to a conduit repo; drop fsutil; add JSON prettified in devel mode; add flake; drop email; more tests
1 parent 78800f3 commit 93d106b

24 files changed

+251
-593
lines changed

.gitignore

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,go,vim,linux,node
1+
# Created by https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node,direnv
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,go,vim,linux,node,direnv
3+
4+
### direnv ###
5+
.direnv
6+
.envrc
37

48
### Go ###
59
# If you prefer the allow list template instead of the deny list, see community template:
@@ -232,4 +236,4 @@ tags
232236
# Persistent undo
233237
[._]*.un~
234238

235-
# End of https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node
239+
# End of https://www.toptal.com/developers/gitignore/api/macos,go,vim,linux,node,direnv

.test.env

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
DATABASE_URI="postgresql://local:local@localhost:5432/local?sslmode=disable"
2-

debug/assert_test.go

+7-14
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@
22

33
package debug
44

5-
import "testing"
5+
import (
6+
"testing"
7+
8+
"github.com/stretchr/testify/assert"
9+
)
610

711
func TestAssert(t *testing.T) {
812
t.Run("it works", func(t *testing.T) {
913
Assert(true, "it works")
10-
assertPanic(t, func() {
14+
assert.Panics(t, func() {
1115
Assert(false, "it should panic")
12-
})
16+
}, "Expected Assert(false, ...) to panic")
1317
})
1418
}
15-
16-
func assertPanic(t *testing.T, f func()) {
17-
t.Helper()
18-
defer func() {
19-
if r := recover(); r == nil {
20-
t.Fatal("expected panic")
21-
}
22-
}()
23-
24-
f()
25-
}

email/email.go

-19
This file was deleted.

flake.lock

+60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
description = "foundations - a modular library designed to build maintainable production-grade systems.";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
in
14+
{
15+
devShells.default = pkgs.mkShell {
16+
buildInputs = with pkgs; [
17+
nodejs
18+
go_1_23
19+
sqlc
20+
golangci-lint
21+
postgresql_16
22+
];
23+
};
24+
}
25+
);
26+
}

fsutil/fsutil.go

-23
This file was deleted.

fsutil/fsutil_test.go

-104
This file was deleted.

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/jackc/puddle/v2 v2.2.1
1313
github.com/joho/godotenv v1.5.1
1414
github.com/samber/lo v1.47.0
15+
github.com/spf13/cobra v1.8.1
1516
github.com/stretchr/testify v1.9.0
1617
go.inout.gg/shield v0.0.0-20240827214956-d2b7a49e7e6f
1718
golang.org/x/crypto v0.26.0
@@ -23,12 +24,14 @@ require (
2324
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
2425
github.com/go-playground/locales v0.14.1 // indirect
2526
github.com/go-playground/universal-translator v0.18.1 // indirect
27+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2628
github.com/jackc/pgpassfile v1.0.0 // indirect
2729
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
2830
github.com/kr/text v0.2.0 // indirect
2931
github.com/leodido/go-urn v1.4.0 // indirect
3032
github.com/pmezard/go-difflib v1.0.0 // indirect
3133
github.com/rogpeppe/go-internal v1.12.0 // indirect
34+
github.com/spf13/pflag v1.0.5 // indirect
3235
golang.org/x/net v0.27.0 // indirect
3336
golang.org/x/sys v0.23.0 // indirect
3437
golang.org/x/text v0.17.0 // indirect

go.sum

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ github.com/a-h/templ v0.2.747 h1:D0dQ2lxC3W7Dxl6fxQ/1zZHBQslSkTSvl5FxP/CfdKg=
22
github.com/a-h/templ v0.2.747/go.mod h1:69ObQIbrcuwPCU32ohNaWce3Cb7qM5GMiqN1K+2yop4=
33
github.com/caarlos0/env/v11 v11.1.0 h1:a5qZqieE9ZfzdvbbdhTalRrHT5vu/4V1/ad1Ka6frhI=
44
github.com/caarlos0/env/v11 v11.1.0/go.mod h1:LwgkYk1kDvfGpHthrWWLof3Ny7PezzFwS4QrsJdHTMo=
5+
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
56
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
67
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
78
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -23,6 +24,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2324
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2425
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
2526
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
27+
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
28+
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
2629
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
2730
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
2831
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
@@ -43,8 +46,13 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
4346
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
4447
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
4548
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
49+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
4650
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
4751
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
52+
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
53+
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
54+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
55+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
4856
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
4957
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5058
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=

0 commit comments

Comments
 (0)