1
0

service_other.go 649 B

1234567891011121314151617181920212223
  1. //go:build !windows
  2. package main
  3. import "fmt"
  4. // runPlatformService 非 Windows 平台不支持服务模式
  5. func runPlatformService() error {
  6. return fmt.Errorf("服务模式仅支持 Windows")
  7. }
  8. // windowsServiceRunning 非 Windows 平台不存在 Windows 服务
  9. func windowsServiceRunning() bool { return false }
  10. // startPlatformService 非 Windows 平台无法创建服务
  11. func startPlatformService() (string, error) {
  12. return "", fmt.Errorf("服务模式仅支持 Windows")
  13. }
  14. // stopPlatformService 非 Windows 平台无法停止服务
  15. func stopPlatformService() (string, error) {
  16. return "", fmt.Errorf("服务模式仅支持 Windows")
  17. }