chaos-client icon indicating copy to clipboard operation
chaos-client copied to clipboard

Chaos as a library documentation involves use of internal package

Open DanielIntruder opened this issue 10 months ago • 1 comments

Chaos library version: 0.5.2

Current Behavior:

The sample code for using chaos as a library imports the internal/runner package, which can only be accessed from parents of this package due to the internal prefix. This causes an error when trying to use chaos as a library:

main.go:6:2: use of internal package github.com/projectdiscovery/chaos-client/internal/runner not allowed

Expected Behavior:

The runner package should not be internal, or the documentation should provide a way to run chaos as a library that avoids this error.

Steps To Reproduce:

  1. Create a new directory and copy the sample code to main.go.
  2. Initialise a go module in the director (go mod init a.com/test) and fetch dependencies (go mod tidy).
  3. Run the sample code (go run main.go).

Anything else:

https://www.bytesizego.com/blog/golang-internal-package

DanielIntruder avatar Mar 03 '25 12:03 DanielIntruder

I’ll work on a fix for this issue.

oxqnd avatar Sep 22 '25 10:09 oxqnd