Skip to content

Commit f568c27

Browse files
steveyeggeclaude
andcommitted
fix: add pressure stubs for Windows/FreeBSD (release build fix)
GoReleaser cross-compilation failed because availableMemoryGB and loadAverage1Sysctl were only defined for darwin and linux. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b02065 commit f568c27

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

internal/daemon/pressure_other.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//go:build !darwin && !linux && !windows
2+
3+
package daemon
4+
5+
// loadAverage1Sysctl is a no-op on unsupported platforms.
6+
func loadAverage1Sysctl() float64 {
7+
return 0
8+
}
9+
10+
// availableMemoryGB is a no-op on unsupported platforms.
11+
func availableMemoryGB() float64 {
12+
return 0
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package daemon
2+
3+
// loadAverage1Sysctl is a no-op on Windows — load average is not a standard metric.
4+
func loadAverage1Sysctl() float64 {
5+
return 0
6+
}
7+
8+
// availableMemoryGB is a no-op on Windows — pressure checks are not supported.
9+
func availableMemoryGB() float64 {
10+
return 0
11+
}

0 commit comments

Comments
 (0)