Skip to content

Commit ef605a8

Browse files
Fix: linting
1 parent e162368 commit ef605a8

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

pkg/configReader/helper/createEnvFile.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package main
77
import (
88
"bufio"
99
"fmt"
10+
"io/fs"
1011
"os"
1112
"path/filepath"
1213
"regexp"
@@ -17,7 +18,15 @@ func main() {
1718
// Find all Go files in the current directory and its subdirectories
1819
var envVarsGoFile []string
1920
var envVars []string
20-
err := filepath.Walk("internal/", func(path string, info os.FileInfo, err error) error {
21+
22+
root, err := os.OpenRoot("internal/")
23+
if err != nil {
24+
fmt.Println(err)
25+
return
26+
}
27+
defer root.Close()
28+
29+
err = fs.WalkDir(root.FS(), ".", func(path string, info fs.DirEntry, err error) error {
2130
if err != nil {
2231
return err
2332
}
@@ -33,7 +42,7 @@ func main() {
3342

3443
// Parse the Go file and look for structs with the "viperEnv" tag
3544
fmt.Printf("Looking for %s\n", path)
36-
file, err := os.Open(path)
45+
file, err := root.Open(path)
3746
if err != nil {
3847
return err
3948
}

pkg/openSearch/openSearchClient/client.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ type Client struct {
3333
// openSearchProjectClient is the official OpenSearch client to wrap. Use NewOpenSearchProjectClient to create it.
3434
// updateMaxRetries is the number of retries for update requests.
3535
// updateRetryDelay is the delay between retries.
36-
func NewClient(openSearchProjectClient *opensearchapi.Client, updateMaxRetries int, updateRetryDelay time.Duration) *Client {
36+
func NewClient(
37+
openSearchProjectClient *opensearchapi.Client,
38+
updateMaxRetries int,
39+
updateRetryDelay time.Duration,
40+
) *Client {
3741
c := &Client{
3842
openSearchProjectClient: openSearchProjectClient,
3943
}
@@ -107,7 +111,12 @@ func (c *Client) Count(indexName string, requestBody []byte) (count int64, err e
107111
return countResp.Count, nil
108112
}
109113

110-
func (c *Client) SearchStream(indexName string, requestBody []byte, scrollTimeout time.Duration, ctx context.Context) (io.Reader, error) {
114+
func (c *Client) SearchStream(
115+
indexName string,
116+
requestBody []byte,
117+
scrollTimeout time.Duration,
118+
ctx context.Context,
119+
) (io.Reader, error) {
111120
reader, writer := io.Pipe()
112121
startSignal := make(chan error, 1)
113122

@@ -208,7 +217,7 @@ func (c *Client) SearchStream(indexName string, requestBody []byte, scrollTimeou
208217
clearScrollReq := opensearchapi.ScrollDeleteReq{
209218
ScrollIDs: []string{scrollID},
210219
}
211-
_, err = c.openSearchProjectClient.Scroll.Delete(context.Background(), clearScrollReq)
220+
_, err = c.openSearchProjectClient.Scroll.Delete(ctx, clearScrollReq)
212221
if err != nil {
213222
log.Warn().Err(err).Msgf("failed to delete scroll context")
214223
}

0 commit comments

Comments
 (0)