Skip to content

Commit 3a4c745

Browse files
committed
Move errProcessInfoMissing to platform-independent file
errProcessInfoMissing was defined in command_linux.go (linux-only build tag) but referenced from memorylimit.go which compiles on all platforms, causing a build failure on non-Linux systems.
1 parent 3f94cd7 commit 3a4c745

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

pipe/command.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515
"golang.org/x/sync/errgroup"
1616
)
1717

18+
var errProcessInfoMissing = errors.New("cmd.Process is nil")
19+
1820
// commandStage is a pipeline `Stage` based on running an external
1921
// command and piping the data through its stdin and stdout.
2022
type commandStage struct {

pipe/command_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@ package pipe
44

55
import (
66
"context"
7-
"errors"
87

98
"github.com/github/go-pipe/internal/ptree"
109
)
1110

1211
// On linux, we can limit or observe memory usage in command stages.
1312
var _ LimitableStage = (*commandStage)(nil)
1413

15-
var (
16-
errProcessInfoMissing = errors.New("cmd.Process is nil")
17-
)
18-
1914
func (s *commandStage) GetRSSAnon(_ context.Context) (uint64, error) {
2015
if s.cmd.Process == nil {
2116
return 0, errProcessInfoMissing

0 commit comments

Comments
 (0)