Skip to content

Commit 28c34bd

Browse files
committed
Enable and run the modernize linter
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent 04dc847 commit 28c34bd

26 files changed

Lines changed: 61 additions & 62 deletions

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ linters:
4242
- makezero
4343
- mirror
4444
- misspell
45+
- modernize
4546
- musttag
4647
- nakedret
4748
- nestif

opensearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) {
237237
}
238238

239239
// Do gets and performs the request. It also tries to parse the response into the dataPointer
240-
func (c *Client) Do(ctx context.Context, req Request, dataPointer interface{}) (*Response, error) {
240+
func (c *Client) Do(ctx context.Context, req Request, dataPointer any) (*Response, error) {
241241
httpReq, err := req.GetRequest()
242242
if err != nil {
243243
return nil, err

opensearchapi/api_document-delete_by_query-params.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ type DocumentDeleteByQueryParams struct {
5757
SearchTimeout time.Duration
5858
SearchType string
5959
Size *int
60-
Slices interface{}
60+
Slices any
6161
Sort []string
62-
Source interface{}
62+
Source any
6363
SourceExcludes []string
6464
SourceIncludes []string
6565
Stats []string

opensearchapi/api_document-exists-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type DocumentExistsParams struct {
3737
Realtime *bool
3838
Refresh *bool
3939
Routing string
40-
Source interface{}
40+
Source any
4141
SourceExcludes []string
4242
SourceIncludes []string
4343
StoredFields []string

opensearchapi/api_document-exists_source-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type DocumentExistsSourceParams struct {
3737
Realtime *bool
3838
Refresh *bool
3939
Routing string
40-
Source interface{}
40+
Source any
4141
SourceExcludes []string
4242
SourceIncludes []string
4343
Version *int

opensearchapi/api_document-explain-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type DocumentExplainParams struct {
4141
Preference string
4242
Query string
4343
Routing string
44-
Source interface{}
44+
Source any
4545
SourceExcludes []string
4646
SourceIncludes []string
4747
StoredFields []string

opensearchapi/api_document-get-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type DocumentGetParams struct {
3737
Realtime *bool
3838
Refresh *bool
3939
Routing string
40-
Source interface{}
40+
Source any
4141
SourceExcludes []string
4242
SourceIncludes []string
4343
StoredFields []string

opensearchapi/api_document-source-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type DocumentSourceParams struct {
3838
Refresh *bool
3939
Routing string
4040
// Deprecated: This parameter is similar to SourceIncludes, please use that instead.
41-
Source interface{}
41+
Source any
4242
SourceExcludes []string
4343
SourceIncludes []string
4444
Version *int

opensearchapi/api_mget-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type MGetParams struct {
3737
Realtime *bool
3838
Refresh *bool
3939
Routing string
40-
Source interface{}
40+
Source any
4141
SourceExcludes []string
4242
SourceIncludes []string
4343
StoredFields []string

opensearchapi/api_reindex-params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type ReindexParams struct {
3939
Refresh *bool
4040
RequestsPerSecond *int
4141
Scroll time.Duration
42-
Slices interface{}
42+
Slices any
4343
Timeout time.Duration
4444
WaitForActiveShards string
4545
WaitForCompletion *bool

0 commit comments

Comments
 (0)