-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: add godoc link everywhere possible. #1112
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -947,7 +947,7 @@ func (r *Runner) readLine(ctx context.Context, raw bool) ([]byte, error) { | |
// [cancelreader.NewReader] may fail under some circumstances, such as r.stdin being | ||
// a regular file on Linux, in which case epoll returns an "operation not permitted" error | ||
// given that regular files can always be read immediately. Polling them makes no sense. | ||
// As such, if cancelreader fails, fall back to no cancellation, meaning this is best-effort. | ||
// As such, if [cancelreader] fails, fall back to no cancellation, meaning this is best-effort. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this code is gone from master now; removing this change. |
||
// | ||
// TODO: it would be nice if the cancelreader library classified errors so that we could | ||
// safely handle "this file does not need polling" by skipping the polling as we do below | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,8 +134,9 @@ func DefaultExecHandler(killTimeout time.Duration) ExecHandlerFunc { | |
|
||
switch err := err.(type) { | ||
case *exec.ExitError: | ||
// Windows and Plan9 do not have support for syscall.WaitStatus | ||
// with methods like Signaled and Signal, so for those, waitStatus is a no-op. | ||
// Windows and Plan9 do not have support for [syscall.WaitStatus] | ||
// with methods like Signaled and Signal, so for those, [waitStatus] is a no-op. | ||
// Note: [waitStatus] is an alias [syscall.WaitStatus] | ||
if status, ok := err.Sys().(waitStatus); ok && status.Signaled() { | ||
if ctx.Err() != nil { | ||
return ctx.Err() | ||
|
@@ -209,7 +210,7 @@ func LookPath(env expand.Environ, file string) (string, error) { | |
return LookPathDir(env.Get("PWD").String(), env, file) | ||
} | ||
|
||
// LookPathDir is similar to [os/exec.LookPath], with the difference that it uses the | ||
// LookPathDir is similar to os/[exec.LookPath], with the difference that it uses the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also reverting this one. |
||
// provided environment. env is used to fetch relevant environment variables | ||
// such as PWD and PATH. | ||
// | ||
|
@@ -218,7 +219,7 @@ func LookPathDir(cwd string, env expand.Environ, file string) (string, error) { | |
return lookPathDir(cwd, env, file, findExecutable) | ||
} | ||
|
||
// findAny defines a function to pass to lookPathDir. | ||
// findAny defines a function to pass to [lookPathDir]. | ||
type findAny = func(dir string, file string, exts []string) (string, error) | ||
|
||
func lookPathDir(cwd string, env expand.Environ, file string, find findAny) (string, error) { | ||
|
@@ -254,7 +255,7 @@ func lookPathDir(cwd string, env expand.Environ, file string, find findAny) (str | |
return "", fmt.Errorf("%q: executable file not found in $PATH", file) | ||
} | ||
|
||
// scriptFromPathDir is similar to LookPathDir, with the difference that it looks | ||
// scriptFromPathDir is similar to [LookPathDir], with the difference that it looks | ||
// for both executable and non-executable files. | ||
func scriptFromPathDir(cwd string, env expand.Environ, file string) (string, error) { | ||
return lookPathDir(cwd, env, file, findFile) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ func TestRunnerTerminalStdIO(t *testing.T) { | |
|
||
r, _ := interp.New(interp.StdIO(secondaryReader, secondary, secondary)) | ||
go func() { | ||
// To mimic os/exec.Cmd.Start, use a goroutine. | ||
// To mimic os/[exec.Cmd.Start], use a goroutine. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tweaking to quote the entire qualified name, like the others. |
||
if err := r.Run(context.Background(), file); err != nil { | ||
t.Error(err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm undoing this change as it seems unnecessary and makes the linking less consistent.