Compare commits
2 Commits
a3162a3e5f
...
1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| bdbe1a9416 | |||
| e6801007ee |
@@ -29,10 +29,7 @@ Key product constraints:
|
|||||||
## Build and test
|
## Build and test
|
||||||
|
|
||||||
Use `make help` as the source of truth for available build/test targets and descriptions.
|
Use `make help` as the source of truth for available build/test targets and descriptions.
|
||||||
Always build and test via make unless it doesn't include targets for that.
|
Format, Test, Build are the required steps before being done with any coding if there are more then one target for any of these then run them all before considering that step complete.
|
||||||
Also in the event there is a test without race checking and one with do both.
|
|
||||||
Otherwise just whats available.
|
|
||||||
To verify your changes you must run tests and do a build.
|
|
||||||
|
|
||||||
## Coding conventions
|
## Coding conventions
|
||||||
|
|
||||||
|
|||||||
@@ -18,26 +18,26 @@ help:
|
|||||||
@echo " make fmt - Format Go code"
|
@echo " make fmt - Format Go code"
|
||||||
@echo " make clean - Remove built artifacts"
|
@echo " make clean - Remove built artifacts"
|
||||||
|
|
||||||
run: dev
|
run: dev # Run the application alias for dev.
|
||||||
|
|
||||||
dev: build
|
dev: build # Run the application.
|
||||||
$(BIN) server --config $(CONFIG)
|
$(BIN) server --config $(CONFIG)
|
||||||
|
|
||||||
build: clean
|
build: clean # Build the application.
|
||||||
npm --prefix ./web/ui run build
|
npm --prefix ./web/ui run build
|
||||||
mkdir -p $(BIN_DIR)
|
mkdir -p $(BIN_DIR)
|
||||||
CGO_ENABLED=0 go build -o $(BIN) $(CMD_DIR)
|
CGO_ENABLED=0 go build -o $(BIN) $(CMD_DIR)
|
||||||
|
|
||||||
docker:
|
docker: # Build the Docker image.
|
||||||
docker build -t $(DOCKER_IMAGE) .
|
docker build -t $(DOCKER_IMAGE) .
|
||||||
|
|
||||||
test:
|
test: # Run the tests.
|
||||||
go test -timeout 30s -shuffle=on ./...
|
go test -timeout 30s -shuffle=on ./...
|
||||||
|
|
||||||
test-race:
|
test-race: # Run the tests with the race detector.
|
||||||
go test -race -timeout 30s -shuffle=on ./...
|
go test -race -timeout 30s -shuffle=on ./...
|
||||||
|
|
||||||
fmt:
|
fmt: # Format the code using gofmt.
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
indexFilename = "metadata"
|
indexFilename = "metadata"
|
||||||
filesDirName = "scratches"
|
filesDirName = "scratches"
|
||||||
encryptedChunkSize = 64 * 1024
|
encryptedChunkSize = 64 * 1024
|
||||||
publicIDLength = 12
|
publicIDLength = 12
|
||||||
publicIDAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
publicIDAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
||||||
publicIDMaxAttempts = 8
|
publicIDMaxAttempts = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNotFound = errors.New("scratch not found")
|
var ErrNotFound = errors.New("scratch not found")
|
||||||
|
|||||||
Reference in New Issue
Block a user