Skip to content

Commit bf3b428

Browse files
authored
chore: go fmt across the repo (#288)
fd go.mod -x sh -c 'cd {//} && go fmt ./...' Signed-off-by: kranurag7 <81210977+kranurag7@users.noreply.github.com>
1 parent cec6f95 commit bf3b428

File tree

12 files changed

+54
-59
lines changed

12 files changed

+54
-59
lines changed

chelm/internal/chelm/parse.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ func validateMarkers(m *images.Mapping) error {
6262
_, err = images.Parse(bytes.NewReader(data))
6363
return err
6464
}
65-

chelm/internal/chelm/values.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,3 @@ func resolveField(f images.RefField, repo name.Repository) string {
104104
return ""
105105
}
106106
}
107-

no-docs-check/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ func getDocumentationPaths() []string {
134134
"usr/man/",
135135
"usr/share/info/",
136136
"usr/local/share/info/",
137-
"usr/share/doc",
138-
"usr/share/local/doc",
139-
"usr/local/share/doc",
137+
"usr/share/doc",
138+
"usr/share/local/doc",
139+
"usr/local/share/doc",
140140
}
141141
}
142142

143143
func isDocumentationFile(filePath string, docPaths []string) bool {
144144
for _, docPath := range docPaths {
145145
if strings.HasPrefix(filePath, docPath) {
146-
if filepath.Base(filePath) == "dir" {
146+
if filepath.Base(filePath) == "dir" {
147147
continue
148148
}
149149
return true

package-type-check/pkg/checkers/dev.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ func CheckDevPackage(pkg string) error {
3636
fmt.Printf("PASS [3/3]: Dev package [%s] contains header files under /usr\n", pkg)
3737

3838
return nil
39-
}
39+
}

package-type-check/pkg/checkers/empty.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ func CheckEmptyPackage(pkg string) error {
2626

2727
fmt.Printf("PASS: Package [%s] is empty", pkg)
2828

29-
return nil
29+
return nil
3030
}

tw/pkg/commands/dgrep/dgrep.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ var commonErrorPatterns = []string{
4242
}
4343

4444
type cfg struct {
45-
Container string
46-
Timeout time.Duration
47-
IgnoreCase bool
48-
Retry int
49-
Patterns []string
50-
NotExpected []string
45+
Container string
46+
Timeout time.Duration
47+
IgnoreCase bool
48+
Retry int
49+
Patterns []string
50+
NotExpected []string
5151
NotExpectedExclude []string
52-
InvertMatch bool
53-
DefaultErrors bool
52+
InvertMatch bool
53+
DefaultErrors bool
5454

55-
compiled []*regexp.Regexp
55+
compiled []*regexp.Regexp
5656
notExpectedCompiled []*regexp.Regexp
57-
highlighter func(string) string
57+
highlighter func(string) string
5858
}
5959

6060
func Command() *cobra.Command {
@@ -152,7 +152,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
152152
scanner := bufio.NewScanner(strings.NewReader(stdoutBuf.String()))
153153
for scanner.Scan() {
154154
line := scanner.Text()
155-
155+
156156
// Check expected patterns
157157
for i, re := range c.compiled {
158158
if re.MatchString(line) {
@@ -164,7 +164,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
164164
break
165165
}
166166
}
167-
167+
168168
// Check not-expected patterns
169169
for _, re := range c.notExpectedCompiled {
170170
if re.MatchString(line) {
@@ -180,7 +180,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
180180
scanner = bufio.NewScanner(strings.NewReader(stderrBuf.String()))
181181
for scanner.Scan() {
182182
line := scanner.Text()
183-
183+
184184
// Check expected patterns
185185
for i, re := range c.compiled {
186186
if re.MatchString(line) {
@@ -191,7 +191,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
191191
matchedPatterns[i] = true
192192
}
193193
}
194-
194+
195195
// Check not-expected patterns
196196
for _, re := range c.notExpectedCompiled {
197197
if re.MatchString(line) {
@@ -206,7 +206,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
206206
// Print all matches at the end
207207
nmatches := len(matches)
208208
nNotExpected := len(notExpectedMatches)
209-
209+
210210
clog.InfoContextf(ctx, "found %d expected matches in container %s", nmatches, c.Container)
211211
for i, m := range matches {
212212
clog.InfoContextf(ctx, "-- [%d/%d] expected in %s: %s", i+1, nmatches, m.Container, m.Text)
@@ -258,7 +258,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
258258
// Start with all default patterns
259259
patterns := make([]string, len(commonErrorPatterns))
260260
copy(patterns, commonErrorPatterns)
261-
261+
262262
// Remove excluded patterns
263263
for _, exclude := range c.NotExpectedExclude {
264264
filtered := []string{}
@@ -269,7 +269,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
269269
}
270270
patterns = filtered
271271
}
272-
272+
273273
// Add defaults (after exclusions) to not-expected patterns
274274
c.NotExpected = append(c.NotExpected, patterns...)
275275
}

tw/pkg/commands/kgrep/kgrep.go

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ var commonErrorPatterns = []string{
4343
}
4444

4545
type cfg struct {
46-
Name string
47-
Namespace string
48-
Timeout time.Duration
49-
IgnoreCase bool
50-
Container string
51-
Retry int
52-
Patterns []string
53-
NotExpected []string
46+
Name string
47+
Namespace string
48+
Timeout time.Duration
49+
IgnoreCase bool
50+
Container string
51+
Retry int
52+
Patterns []string
53+
NotExpected []string
5454
NotExpectedExclude []string
55-
InvertMatch bool
56-
DefaultErrors bool
55+
InvertMatch bool
56+
DefaultErrors bool
5757

58-
names []string
59-
compiled []*regexp.Regexp
58+
names []string
59+
compiled []*regexp.Regexp
6060
notExpectedCompiled []*regexp.Regexp
61-
highlighter func(string) string
61+
highlighter func(string) string
6262
}
6363

6464
func Command() *cobra.Command {
@@ -151,7 +151,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
151151
matches := []match{}
152152
matchedPatterns := make(map[int]bool)
153153
notExpectedMatches := []match{}
154-
154+
155155
for obj, req := range reqs {
156156
stream, err := req.Stream(ctx)
157157
if err != nil {
@@ -162,7 +162,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
162162
scanner := bufio.NewScanner(stream)
163163
for scanner.Scan() {
164164
line := scanner.Text()
165-
165+
166166
// Check expected patterns
167167
for i, re := range c.compiled {
168168
if re.MatchString(line) {
@@ -174,7 +174,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
174174
matchedPatterns[i] = true
175175
}
176176
}
177-
177+
178178
// Check not-expected patterns
179179
for _, re := range c.notExpectedCompiled {
180180
if re.MatchString(line) {
@@ -190,7 +190,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
190190

191191
nmatches := len(matches)
192192
nNotExpected := len(notExpectedMatches)
193-
193+
194194
clog.InfoContextf(ctx, "found %d expected matches in %s", nmatches, infos[0].String())
195195
for i, m := range matches {
196196
clog.InfoContextf(ctx, "-- [%d/%d] expected in %s/%s: %s", i+1, nmatches, m.Name, m.Namespace, m.Text)
@@ -203,7 +203,6 @@ func (c *cfg) retryableRun(ctx context.Context) error {
203203
}
204204
}
205205

206-
207206
if c.InvertMatch && nmatches > 0 {
208207
return fmt.Errorf("found %d unwanted matches in %s", nmatches, infos[0].String())
209208
}
@@ -243,7 +242,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
243242
// Start with all default patterns
244243
patterns := make([]string, len(commonErrorPatterns))
245244
copy(patterns, commonErrorPatterns)
246-
245+
247246
// Remove excluded patterns
248247
for _, exclude := range c.NotExpectedExclude {
249248
filtered := []string{}
@@ -254,7 +253,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
254253
}
255254
patterns = filtered
256255
}
257-
256+
258257
// Add defaults (after exclusions) to not-expected patterns
259258
c.NotExpected = append(c.NotExpected, patterns...)
260259
}

tw/pkg/commands/shelldeps/check_package.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,3 @@ func (c *checkPackageCfg) outputPackageResults(w io.Writer, results []packageChe
399399

400400
return nil
401401
}
402-

tw/pkg/commands/shelldeps/check_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ grep pattern file
5555
curl https://example.com
5656
`,
5757
},
58-
binaries: []string{},
59-
strict: true,
60-
wantError: true,
58+
binaries: []string{},
59+
strict: true,
60+
wantError: true,
6161
wantOutput: []string{"curl"},
6262
},
6363
{

tw/pkg/commands/shelldeps/gnucompat.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ var gnuOnlyFlags = map[string]map[string]string{
5454
"--output": "df --output (GNU only)",
5555
},
5656
"readlink": {
57-
"-e": "readlink -e (GNU only, use -f for busybox)",
57+
"-e": "readlink -e (GNU only, use -f for busybox)",
5858
"--canonicalize-existing": "readlink --canonicalize-existing (GNU only)",
59-
"-m": "readlink -m (GNU only)",
60-
"--canonicalize-missing": "readlink --canonicalize-missing (GNU only)",
59+
"-m": "readlink -m (GNU only)",
60+
"--canonicalize-missing": "readlink --canonicalize-missing (GNU only)",
6161
},
6262
"tail": {
6363
"--pid": "tail --pid (GNU only)",

0 commit comments

Comments
 (0)