Commit d7f66ae
authored
[build] Add go mod tidy before go mod vendor for Go 1.24 compat (#157)
What: Adds a go mod tidy step before go mod vendor in the Makefile's $(GO_DEPS) target, with a version guard that only runs tidy when installed Go >= go.mod's directive.
Why: Go 1.24 (Debian Trixie) enforces stricter module graph consistency, causing go mod vendor to fail unless go mod tidy runs first. On older Go (e.g. bookworm Go 1.21), tidy is skipped — no behavior change.
How: Shell-based version comparison using sort -V to compare installed Go version against go.mod directive. Same pattern as sonic-mgmt-common#207.
Testing: CI green, built successfully under Trixie (Go 1.24) and bookworm (Go 1.21). PR approved.
Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>1 parent 79619b6 commit d7f66ae
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
0 commit comments