Skip to content

Commit 5e7fb24

Browse files
committed
chore: improve comments
1 parent cc9cbf4 commit 5e7fb24

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func Example_openTelemetryMetric() {
184184
// helloWorld shutdown
185185
}
186186

187-
// This example demonstrates how to use [kod.WithInterceptors] to provide global interceptors to the application.
187+
// This example demonstrates how to use [kod.Kod.SetInterceptors] to provide global interceptors to the application.
188188
func Example_interceptorGlobal() {
189189
itcpt := interceptor.Interceptor(func(ctx context.Context, info interceptor.CallInfo, req, res []interface{}, next interceptor.HandleFunc) error {
190190
fmt.Println("Before call")
@@ -207,7 +207,7 @@ func Example_interceptorGlobal() {
207207
// helloWorld shutdown
208208
}
209209

210-
// This example demonstrates how to use [kod.WithInterceptors] to provide component-specific interceptors to the application.
210+
// This example demonstrates how to use [kod.Kod.SetInterceptors] to provide component-specific interceptors to the application.
211211
func Example_interceptorComponent() {
212212
kod.Run(context.Background(), func(ctx context.Context, app *helloworld.App) error {
213213
app.HelloWorldInterceptor.Get().SayHello(ctx)
@@ -221,7 +221,7 @@ func Example_interceptorComponent() {
221221
// helloWorld shutdown
222222
}
223223

224-
// This example demonstrates how to use built-in interceptors with [kod.WithInterceptors].
224+
// This example demonstrates how to use built-in interceptors with [kod.Kod.SetInterceptors].
225225
// Such as [krecovery.Interceptor], [ktrace.Interceptor], and [kmetric.Interceptor] ...
226226
func Example_interceptorBuiltin() {
227227
kod.Run(context.Background(), func(ctx context.Context, app *helloworld.App) error {

tests/case1/panic_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestPanicRecovery(t *testing.T) {
1616
})
1717
}
1818

19-
func TestRunWithInterceptor(t *testing.T) {
19+
func TestRunSetInterceptor(t *testing.T) {
2020
t.Parallel()
2121

2222
t.Run("panicNoRecvoeryCase with interceptor", func(t *testing.T) {

0 commit comments

Comments
 (0)