Skip to content

Commit 559bdb3

Browse files
authored
Merge pull request #991 from ydb-platform/noctx
noctx enabled
2 parents 321be1b + d8e7a31 commit 559bdb3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ linters:
241241
- nakedret
242242
- nilerr
243243
- nlreturn
244-
- noctx
245244
- nonamedreturns
246245
- nosnakecase
247246
- paralleltest

examples/serverless/healthcheck/service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ func (s *service) createTableIfNotExists(ctx context.Context) error {
9090
)
9191
}
9292

93-
func (s *service) ping(path string) (code int32, err error) {
93+
func (s *service) ping(ctx context.Context, path string) (code int32, err error) {
9494
uri, err := url.Parse(path)
9595
if err != nil {
9696
return -1, err
9797
}
9898
if uri.Scheme == "" {
9999
uri.Scheme = "http"
100100
}
101-
request, err := http.NewRequest(http.MethodGet, uri.String(), nil) //nolint:gocritic
101+
request, err := http.NewRequestWithContext(ctx, http.MethodGet, uri.String(), nil) //nolint:gocritic
102102
if err != nil {
103103
return -1, err
104104
}
@@ -130,7 +130,7 @@ func (s *service) check(ctx context.Context, urls []string) error {
130130
go func(idx int, u string) {
131131
defer wg.Done()
132132
out := " > '" + u + "' => "
133-
code, err := s.ping(u)
133+
code, err := s.ping(ctx, u)
134134
if err != nil {
135135
fmt.Println(out + err.Error())
136136
} else {

0 commit comments

Comments
 (0)