Commit Graph
13 Commits
Author SHA1 Message Date
Cosmin Cojocar 8d1b2c63ae Imprve the test coverage (#1510)
Add more tests in areas which are not currently covered.

Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
2026-02-14 15:47:36 +01:00
Ravi Sastry KadaliandOittaa be0fd6dcfd Debug Build Profiling Support: Code improvement suggestions for PR#1471 (#1476)
* feat: add debug build profiling support

Add CPU and memory profiling capabilities for debug builds using Go build
tags. Profiling code is completely excluded from release builds.

Changes:
- Add profiling_debug.go with -cpuprofile and -memprofile flags (build tag: debug)
- Add build-debug and build-debug-race Makefile targets
- Refactor main() to run() pattern for proper defer handling
- Replace logger.Fatal() with logger.Printf() + return for clean exits
- Pass logger to profiling for consistent [gosec] log prefix

Usage:
  make build-debug
  ./gosec-debug -cpuprofile cpu.prof -memprofile mem.prof ./...

* Refactor profiling: encapsulate state and improve error handling

- Encapsulate profiling state in Profiler struct to eliminate package-level mutable state
- Add proper error handling with error returns instead of silent failures
- Add exit code constants (exitSuccess/exitFailure) to replace magic numbers
- Fix Makefile clean target to remove gosec-debug binary
- Add nil logger guard for safety

* Use exit constants in all return statements

Replace remaining magic numbers (0, 1) with exitSuccess and exitFailure
constants throughout the run() function for consistency.

---------

Co-authored-by: Oittaa <eero@oittaa.net>
2026-01-23 10:38:04 +01:00
Cosmin Cojocar f775eb19c5 Update .gitignore
Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
2024-05-27 13:03:01 +02:00
Marc Brugger 521e69ef66 Allows the exclude-dir option to exclude sub directories 2021-08-04 17:31:16 +02:00
Vinod AnandanandMatthieu MOREL 5032f998a0 Generate SBOM (#655)
* Generate SBOM

* Update release.yml

* Update .github/workflows/release.yml

Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>

* Publish bom.json

* Ignore SBOMs generated during CI

Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
2021-06-21 10:50:44 +02:00
Andrew Hsu 5f98926a7b Refactor Dockerfile (#245)
* ignore the temporary image file used for builds

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* no need for GOPATH in the Dockerfile

It is already set in the golang:1.10.3-alpine3.8 image.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* no need for GOROOT in Dockerfile

The correct value is embedded in the go tool.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* bump Dockerfile golang to 1.10.4

The latest golang version thus far.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* replace docker-entrypoint.sh with the gosec binary

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* git ignore gosec binary

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* refactor Dockerfile into multi-stage

First stage does the build in a pristine alpine environment. Second
stage is a minimal image with just the necessary stuff to run the
compiled binary. Also added packages for gcc and musl-dev so cgo can do
its thang.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>

* fix the image execution example in README.md

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-09-26 08:09:20 +03:00
Cosmin Cojocar 2a6e887167 Use the goreleaser tool to perform releases 2018-07-27 14:42:00 +02:00
Grant Murphy f4b705a864 Use glide to manage vendored dependencies 2017-05-09 21:59:12 -07:00
Grant Murphy bf78d027a9 Restructure and introduce a standalone config 2017-04-28 14:46:26 -07:00
David Lawrence 1a481fad70 adding support for arbitrary paths with ... 2016-12-02 13:54:05 -08:00
Grant Murphy 14e6635ca6 Add tool to inspect call objects in file 2016-11-06 11:17:10 -08:00
Grant Murphy 9ca975d56f Add gas to .gitignore 2016-08-28 11:35:58 -07:00
Tim Kelsey 4f3d620d37 Initial public release 2016-07-20 15:56:32 +01:00