Skip to content

Commit

Permalink
Support build on all unsupported platforms
Browse files Browse the repository at this point in the history
Processes and FindProcesses will always return an error on these
platforms.
  • Loading branch information
tklauser committed Jan 4, 2024
1 parent 12de6be commit b9b8a86
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 32 deletions.
15 changes: 0 additions & 15 deletions process_aix.go

This file was deleted.

15 changes: 0 additions & 15 deletions process_plan9.go

This file was deleted.

4 changes: 2 additions & 2 deletions process_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package ps

Expand Down
21 changes: 21 additions & 0 deletions process_unsupported.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2021 Tobias Klauser. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows
// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows

package ps

import (
"fmt"
"runtime"
)

func processes() ([]Process, error) {
return nil, fmt.Errorf("unsupported on %s", runtime.GOOS)
}

func findProcess(pid int) (Process, error) {
return nil, fmt.Errorf("unsupported on %s", runtime.GOOS)
}

0 comments on commit b9b8a86

Please sign in to comment.