Skip to content

Commit 4101aa7

Browse files
authored
Merge branch 'master' into tagliatelle
2 parents a718e01 + 0f5dc78 commit 4101aa7

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,15 @@ linters:
238238
- ireturn
239239
- maintidx
240240
- maligned
241-
- nakedret
242241
- nilerr
243242
- nlreturn
244-
- noctx
245243
- nonamedreturns
246244
- nosnakecase
247245
- paralleltest
248246
- promlinter
249247
- protogetter
250248
- scopelint
251249
- structcheck
252-
- tagalign
253250
- testableexamples
254251
- testifylint
255252
- testpackage

examples/pagination/cities.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func selectPaging(
6969
}()
7070
if !res.NextResultSet(ctx) || !res.HasNextRow() {
7171
empty = true
72-
return
72+
return res.Err()
7373
}
7474
var addr string
7575
for res.NextRow() {
@@ -86,10 +86,7 @@ func selectPaging(
8686
return res.Err()
8787
},
8888
)
89-
if err != nil {
90-
return
91-
}
92-
return empty, nil
89+
return empty, err
9390
}
9491

9592
func fillTableWithData(ctx context.Context, c table.Client, prefix string) (err error) {

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 {

tests/slo/internal/generator/row.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ type RowID = uint64
66

77
type Row struct {
88
Hash uint64 `gorm:"column:hash;primarykey;autoIncrement:false" xorm:"pk 'hash'"`
9-
ID RowID `gorm:"column:id;primarykey;autoIncrement:false" xorm:"pk 'id'"`
10-
PayloadStr *string `gorm:"column:payload_str" xorm:"'payload_str'"`
11-
PayloadDouble *float64 `gorm:"column:payload_double" xorm:"'payload_double'"`
12-
PayloadTimestamp *time.Time `gorm:"column:payload_timestamp" xorm:"'payload_timestamp'"`
13-
PayloadHash uint64 `gorm:"column:payload_hash" xorm:"'payload_hash'"`
9+
ID RowID `gorm:"column:id;primarykey;autoIncrement:false" xorm:"pk 'id'"` //nolint:tagalign
10+
PayloadStr *string `gorm:"column:payload_str" xorm:"'payload_str'"` //nolint:tagalign
11+
PayloadDouble *float64 `gorm:"column:payload_double" xorm:"'payload_double'"` //nolint:tagalign
12+
PayloadTimestamp *time.Time `gorm:"column:payload_timestamp" xorm:"'payload_timestamp'"` //nolint:tagalign
13+
PayloadHash uint64 `gorm:"column:payload_hash" xorm:"'payload_hash'"` //nolint:tagalign
1414
}

0 commit comments

Comments
 (0)