Skip to content

Commit a647d62

Browse files
authored
Update golangci-lint and fix complains (#740)
* Update golangci-lint to 1.64.8 Signed-off-by: Jakob Hahn <[email protected]> * Fix typo in comments Signed-off-by: Jakob Hahn <[email protected]> * opensearchtransport: fix musttag linter complain Signed-off-by: Jakob Hahn <[email protected]> * fix nolintlint complains Signed-off-by: Jakob Hahn <[email protected]> * golangci: remove deprecated linters Signed-off-by: Jakob Hahn <[email protected]> * opensearchapi: fix MaxScore type to be a pointer Signed-off-by: Jakob Hahn <[email protected]> * golangci: exclude goconst check for all param files Signed-off-by: Jakob Hahn <[email protected]> --------- Signed-off-by: Jakob Hahn <[email protected]>
1 parent 313814a commit a647d62

File tree

188 files changed

+203
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+203
-209
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: golangci-lint
1717
uses: golangci/golangci-lint-action@v3
1818
with:
19-
version: v1.54.2
19+
version: v1.64.8
2020
args: -v -c .golangci.yml
2121
only-new-issues: true
2222

.golangci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ linters:
7070
- errchkjson
7171
- errname
7272
- errorlint
73-
- execinquery
7473
- exhaustive
75-
- exportloopref
7674
- gci
7775
- ginkgolinter
7876
- gocheckcompilerdirectives
@@ -159,7 +157,7 @@ issues:
159157
path: _test\.go
160158
- linters:
161159
- goconst
162-
path: opensearchapi\/api_
160+
path: -params\.go
163161
- linters:
164162
- errcheck
165163
text: "Error return value of `debugLogger.Logf` is not checked"

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1919
- Add more SuggestOptions to SearchResp ([#713](https://github.com/opensearch-project/opensearch-go/pull/713))
2020
- Updates Go version to 1.24 ([#674](https://github.com/opensearch-project/opensearch-go/pull/674))
2121
- Replace `golang.org/x/exp/slices` usage with built-in `slices` ([#674](https://github.com/opensearch-project/opensearch-go/pull/674))
22+
- Update golangci-linter to 1.64.8 ([#740](https://github.com/opensearch-project/opensearch-go/pull/740))
23+
- Change MaxScore to pointer ([#740](https://github.com/opensearch-project/opensearch-go/pull/740))
2224

2325
### Deprecated
2426

@@ -316,7 +318,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
316318
- Uses `[]string` instead of `string` in `SnapshotDeleteRequest` ([#237](https://github.com/opensearch-project/opensearch-go/pull/237))
317319
- Updates workflows to reduce CI time, consolidate OpenSearch versions, update compatibility matrix ([#242](https://github.com/opensearch-project/opensearch-go/pull/242))
318320
- Moves @svencowart to emeritus maintainers ([#270](https://github.com/opensearch-project/opensearch-go/pull/270))
319-
- Reads, closes and replaces the http Reponse Body ([#300](https://github.com/opensearch-project/opensearch-go/pull/300))
321+
- Reads, closes and replaces the http Response Body ([#300](https://github.com/opensearch-project/opensearch-go/pull/300))
320322

321323
### Fixed
322324

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ cluster.clean: ## Remove unused Docker volumes and networks
229229
docker system prune --volumes --force
230230

231231
linters:
232-
docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.54.2:/root/.cache -w /app golangci/golangci-lint:v1.54.2 golangci-lint run --timeout=5m
232+
docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.64.8:/root/.cache -w /app golangci/golangci-lint:v1.64.8 golangci-lint run --timeout=5m
233233

234234
workflow: ## Run all github workflow commands here sequentially
235235

internal/test/helper.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ func NewClient() (*opensearchapi.Client, error) {
3838

3939
// IsSecure returns true when SECURE_INTEGRATION env is set to true
4040
func IsSecure() bool {
41-
//nolint:gosimple // Getenv returns string not bool, if clause is needed
42-
if os.Getenv("SECURE_INTEGRATION") == "true" {
43-
return true
44-
}
45-
return false
41+
return os.Getenv("SECURE_INTEGRATION") == "true"
4642
}
4743

4844
// ClientConfig returns an opensearchapi.Config for secure opensearch

opensearchapi/api_aliases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type AliasesResp struct {
5252
response *opensearch.Response
5353
}
5454

55-
// Inspect returns the Inspect type containing the raw *opensearch.Reponse
55+
// Inspect returns the Inspect type containing the raw *opensearch.Response
5656
func (r AliasesResp) Inspect() Inspect {
5757
return Inspect{Response: r.response}
5858
}

opensearchapi/api_bulk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type BulkRespItem struct {
103103
} `json:"error,omitempty"`
104104
}
105105

106-
// Inspect returns the Inspect type containing the raw *opensearch.Reponse
106+
// Inspect returns the Inspect type containing the raw *opensearch.Response
107107
func (r BulkResp) Inspect() Inspect {
108108
return Inspect{Response: r.response}
109109
}

opensearchapi/api_cat-aliases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type CatAliasResp struct {
5555
IsWriteIndex string `json:"is_write_index"`
5656
}
5757

58-
// Inspect returns the Inspect type containing the raw *opensearch.Reponse
58+
// Inspect returns the Inspect type containing the raw *opensearch.Response
5959
func (r CatAliasesResp) Inspect() Inspect {
6060
return Inspect{
6161
Response: r.response,

opensearchapi/api_cat-allocation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type CatAllocationResp struct {
5959
Node string `json:"node"`
6060
}
6161

62-
// Inspect returns the Inspect type containing the raw *opensearch.Reponse
62+
// Inspect returns the Inspect type containing the raw *opensearch.Response
6363
func (r CatAllocationsResp) Inspect() Inspect {
6464
return Inspect{
6565
Response: r.response,

opensearchapi/api_cat-cluster_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type CatClusterManagerResp struct {
4343
Node string `json:"node"`
4444
}
4545

46-
// Inspect returns the Inspect type containing the raw *opensearch.Reponse
46+
// Inspect returns the Inspect type containing the raw *opensearch.Response
4747
func (r CatClusterManagersResp) Inspect() Inspect {
4848
return Inspect{
4949
Response: r.response,

0 commit comments

Comments
 (0)