MCPcopy Create free account
hub / github.com/coder/envbox / maskErrDotCmd

Function maskErrDotCmd

xunix/exec.go:165–168  ·  view source on GitHub ↗

maskErrDotCmd reverts the behavior of osexec.Cmd to what it was before go1.19 specifically set the Err field to nil (LookPath returns a new error when the file is resolved to the current directory.

(cmd *osexec.Cmd)

Source from the content-addressed store, hash-verified

163// specifically set the Err field to nil (LookPath returns a new error when the file
164// is resolved to the current directory.
165func maskErrDotCmd(cmd *osexec.Cmd) *osexec.Cmd {
166 cmd.Err = maskErrDot(cmd.Err)
167 return cmd
168}
169
170func maskErrDot(err error) error {
171 if err != nil && errors.Is(err, osexec.ErrDot) {

Callers 1

CommandContextMethod · 0.85

Calls 1

maskErrDotFunction · 0.85

Tested by

no test coverage detected