Skip to content

Commit 7c29430

Browse files
committed
Update README.md
1 parent 81edd29 commit 7c29430

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

README.md

+69-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,75 @@ https://github.com/sebajax/go-vertical-slice-architecture/blob/872df7def565c7e0a
184184

185185
https://github.com/sebajax/go-vertical-slice-architecture/blob/eb79ccae805d23b6f77385a5f7ebfc81bb6174e0/pkg/injection/injection.go#L1-L73
186186

187-
## ⚙️ Usage
187+
## ⚙️ Usage without Make
188+
189+
### Docker usage
190+
191+
```bash
192+
# Build server
193+
docker-compose -p go-vertical-slice-architecture build
194+
195+
# Start server
196+
docker-compose up -d
197+
198+
# Stop server
199+
docker-compose down
200+
```
201+
202+
### Standalone usage
203+
204+
```bash
205+
# Live reload
206+
air
207+
```
208+
209+
### Testing
210+
211+
```bash
212+
# To run unit testing
213+
go test
214+
215+
# To run unit testing coverage
216+
go test -cover ./...
217+
```
218+
219+
### Formatting, Linting and Vetting
220+
221+
```bash
222+
# Clean dependencies
223+
go mod tidy
224+
225+
# Run formating
226+
go fmt ./...
227+
228+
# Remove unused imports
229+
goimports -l -w .
230+
231+
# Run linting
232+
golangci-lint run ./...
233+
234+
# Run vetting
235+
go vet ./...
236+
237+
# Run shadow to check shadowed variables
238+
# Install shadow
239+
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
240+
# Run shadow
241+
shadow ./...
242+
```
243+
244+
### Database migration script
245+
246+
```bash
247+
# Create the script
248+
migrate create -ext sql -dir /migrations -seq [script_name]
249+
# Run the script
250+
migrate -database ${POSTGRESQL_URL} -path /migrations up
251+
252+
# It will run automatically when the database initializes
253+
```
254+
255+
## ⚙️ Usage with Make
188256

189257
### Docker usage
190258

0 commit comments

Comments
 (0)