mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-21 21:26:16 +01:00
fix purego build errors on non-supported architectures
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
//go:build (linux || windows) && (amd64 || arm64)
|
||||
|
||||
package agent
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
//go:build linux
|
||||
//go:build linux && (amd64 || arm64)
|
||||
|
||||
package agent
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/ebitengine/purego"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
func openLibrary(name string) (uintptr, error) {
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
//go:build !linux && !windows
|
||||
//go:build (!linux && !windows) || (!amd64 && !arm64)
|
||||
|
||||
package agent
|
||||
|
||||
import "fmt"
|
||||
|
||||
type nvmlCollector struct {
|
||||
gm *GPUManager
|
||||
}
|
||||
|
||||
func (c *nvmlCollector) init() error {
|
||||
return fmt.Errorf("nvml not supported on this platform")
|
||||
}
|
||||
|
||||
func (c *nvmlCollector) start() {}
|
||||
|
||||
func (c *nvmlCollector) collect() {}
|
||||
|
||||
func openLibrary(name string) (uintptr, error) {
|
||||
return 0, fmt.Errorf("nvml not supported on this platform")
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build windows
|
||||
//go:build windows && (amd64 || arm64)
|
||||
|
||||
package agent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user