This commit fixes a critical build issue where the application was being compiled as an archive instead of an executable. This was caused by the absence of a `main` package. The following changes have been made to resolve this and improve the development process: - A `main.go` file has been added to the root of the project to serve as the application's entry point. - A `Taskfile.yml` has been introduced to standardize the build, run, and testing processes. - The build process has been corrected to produce a runnable binary. - An end-to-end test (`TestE2E`) has been added to the test suite. This test builds the application and runs it with the `--help` flag to ensure the binary is always executable, preventing similar build regressions in the future.
27 lines
418 B
YAML
27 lines
418 B
YAML
version: '3'
|
|
|
|
tasks:
|
|
clean:
|
|
cmds:
|
|
- rm -f borg
|
|
build:
|
|
cmds:
|
|
- task: clean
|
|
- GOOS=linux GOARCH=amd64 go build -o borg main.go
|
|
sources:
|
|
- main.go
|
|
- ./pkg/**/*.go
|
|
generates:
|
|
- borg
|
|
run:
|
|
cmds:
|
|
- task: build
|
|
- chmod +x borg
|
|
- ./borg
|
|
deps:
|
|
- build
|
|
test-e2e:
|
|
cmds:
|
|
- task: build
|
|
- chmod +x borg
|
|
- ./borg --help
|