You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`pkg/sliceutil` — slice utilities for cluster management
253
+
213
254
## Default Weights
214
255
215
256
The package embeds a set of default trained weights (in `data/`) via `//go:embed`. Call `coord.LoadDefaultWeights()` to initialize the coordinator with pre-trained cluster weights rather than starting cold.
Copy file name to clipboardExpand all lines: pkg/envutil/README.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,21 @@ The `envutil` package provides utilities for reading and validating environment
6
6
7
7
This package centralizes the pattern of reading integer-valued environment variables, validating them against configured minimum and maximum bounds, and falling back to a default value when the variable is absent or out of range. It emits warning messages to stderr when an invalid value is encountered, following the console formatting conventions of the rest of the codebase.
Reads an integer-valued environment variable, validates it against `[minValue, maxValue]`, and returns `defaultValue` when the variable is absent, unparseable, or out of range. A warning is emitted to `os.Stderr` when the value is invalid.
14
+
15
+
| Parameter | Type | Description |
16
+
|-----------|------|-------------|
17
+
|`envVar`|`string`| Environment variable name (e.g. `"GH_AW_TIMEOUT"`) |
18
+
|`defaultValue`|`int`| Value returned when env var is absent or invalid |
19
+
|`minValue`|`int`| Minimum allowed value (inclusive) |
20
+
|`maxValue`|`int`| Maximum allowed value (inclusive) |
21
+
|`log`|`*logger.Logger`| Optional logger for debug output; pass `nil` to disable |
22
+
23
+
## Usage Examples
12
24
13
25
```go
14
26
import (
@@ -20,24 +32,22 @@ var log = logger.New("mypackage:config")
20
32
21
33
// Read GH_AW_MAX_CONCURRENT_DOWNLOADS, constrained to [1, 20], default 5
Copy file name to clipboardExpand all lines: pkg/fileutil/README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The `fileutil` package provides utility functions for safe file path validation
6
6
7
7
This package focuses on security-conscious file handling: path validation, boundary enforcement, and straightforward file/directory operations. It also provides a cross-platform tar extraction helper.
0 commit comments