Skip to content

Commit 684bd43

Browse files
authored
Merge pull request #264 from dolmen-go/poll-add-godoc-links
poll: add godoc links
2 parents e2be4be + ff92878 commit 684bd43

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

poll/check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66
)
77

8-
// Check is a function which will be used as check for the WaitOn method.
8+
// Check is a function which will be used as check for the [WaitOn] method.
99
type Check func(t LogT) Result
1010

1111
// FileExists looks on filesystem and check that path exists.
@@ -29,7 +29,7 @@ func FileExists(path string) Check {
2929
}
3030

3131
// Connection try to open a connection to the address on the
32-
// named network. See net.Dial for a description of the network and
32+
// named network. See [net.Dial] for a description of the network and
3333
// address parameters.
3434
func Connection(network, address string) Check {
3535
return func(t LogT) Result {

poll/poll.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
"gotest.tools/v3/internal/assert"
1212
)
1313

14-
// TestingT is the subset of testing.T used by WaitOn
14+
// TestingT is the subset of [testing.T] used by [WaitOn]
1515
type TestingT interface {
1616
LogT
1717
Fatalf(format string, args ...interface{})
1818
}
1919

20-
// LogT is a logging interface that is passed to the WaitOn check function
20+
// LogT is a logging interface that is passed to the [WaitOn] check function
2121
type LogT interface {
2222
Log(args ...interface{})
2323
Logf(format string, args ...interface{})
@@ -27,7 +27,7 @@ type helperT interface {
2727
Helper()
2828
}
2929

30-
// Settings are used to configure the behaviour of WaitOn
30+
// Settings are used to configure the behaviour of [WaitOn]
3131
type Settings struct {
3232
// Timeout is the maximum time to wait for the condition. Defaults to 10s.
3333
Timeout time.Duration
@@ -57,7 +57,7 @@ func WithTimeout(timeout time.Duration) SettingOp {
5757
}
5858
}
5959

60-
// Result of a check performed by WaitOn
60+
// Result of a check performed by [WaitOn]
6161
type Result interface {
6262
// Error indicates that the check failed and polling should stop, and the
6363
// the has failed
@@ -86,20 +86,20 @@ func (r result) Error() error {
8686
return r.err
8787
}
8888

89-
// Continue returns a Result that indicates to WaitOn that it should continue
89+
// Continue returns a [Result] that indicates to [WaitOn] that it should continue
9090
// polling. The message text will be used as the failure message if the timeout
9191
// is reached.
9292
func Continue(message string, args ...interface{}) Result {
9393
return result{message: fmt.Sprintf(message, args...)}
9494
}
9595

96-
// Success returns a Result where Done() returns true, which indicates to WaitOn
96+
// Success returns a [Result] where Done() returns true, which indicates to [WaitOn]
9797
// that it should stop polling and exit without an error.
9898
func Success() Result {
9999
return result{done: true}
100100
}
101101

102-
// Error returns a Result that indicates to WaitOn that it should fail the test
102+
// Error returns a [Result] that indicates to [WaitOn] that it should fail the test
103103
// and stop polling.
104104
func Error(err error) Result {
105105
return result{err: err}
@@ -143,9 +143,9 @@ func WaitOn(t TestingT, check Check, pollOps ...SettingOp) {
143143
}
144144
}
145145

146-
// Compare values using the cmp.Comparison. If the comparison fails return a
146+
// Compare values using the [cmp.Comparison]. If the comparison fails return a
147147
// result which indicates to WaitOn that it should continue waiting.
148-
// If the comparison is successful then WaitOn stops polling.
148+
// If the comparison is successful then [WaitOn] stops polling.
149149
func Compare(compare cmp.Comparison) Result {
150150
buf := new(logBuffer)
151151
if assert.RunComparison(buf, assert.ArgsAtZeroIndex, compare) {

0 commit comments

Comments
 (0)