Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rundef/maxprocs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !go1.25

package rundef

import (
Expand Down
21 changes: 21 additions & 0 deletions rundef/maxprocs_go125.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build go1.25

package rundef

import (
"context"
"runtime"

"github.com/circleci/ex/o11y"
)

// MaxProcs is a no-op on Go 1.25+
func MaxProcs(ctx context.Context) (err error) {
ctx, span := o11y.StartSpan(ctx, "rundef: max procs")
defer o11y.End(span, &err)

limit := runtime.GOMAXPROCS(0) // Get the limit the go runtime has determined

span.AddField("limit", limit)
return err
}
2 changes: 2 additions & 0 deletions rundef/maxprocs_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !go1.25

package rundef

import (
Expand Down