Skip to content

Commit 9f0bd47

Browse files
committed
Remove konk structs from exhaustruct exemptions
1 parent e253035 commit 9f0bd47

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.golangci.yml

-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ linters-settings:
3939

4040
exhaustruct:
4141
exclude:
42-
- "^github.com/jclem/konk/konk.Command$"
43-
- "^github.com/jclem/konk/konk.CommandConfig$"
44-
- "^github.com/jclem/konk/konk.RunCommandConfig$"
45-
- "^github.com/jclem/konk/konk.ShellCommandConfig$"
46-
- "^github.com/jclem/konk/konk.RunConcurrentlyConfig$"
4742
- "^github.com/spf13/cobra.Command$"
4843

4944
funlen:

cmd/concurrently.go

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ var cCommand = cobra.Command{
4040
commands, err := konk.RunConcurrently(cmd.Context(), konk.RunConcurrentlyConfig{
4141
Commands: cmdParts,
4242
Labels: labels,
43+
Env: make([]string, 0),
44+
OmitEnv: false,
4345
AggregateOutput: aggregateOutput,
4446
ContinueOnError: continueOnError,
4547
NoColor: noColor,

cmd/proc.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ var procCommand = cobra.Command{
8888
commands, err := konk.RunConcurrently(cmd.Context(), konk.RunConcurrentlyConfig{
8989
Commands: commandStrings,
9090
Labels: commandLabels,
91-
ContinueOnError: continueOnError,
9291
Env: envLines,
9392
OmitEnv: omitEnv,
93+
AggregateOutput: false,
94+
ContinueOnError: continueOnError,
9495
NoColor: noColor,
9596
NoShell: noShell,
9697
})

cmd/serially.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ var sCommand = cobra.Command{
5656
Args: parts[1:],
5757
Label: labels[i],
5858
NoColor: noColor,
59+
Env: make([]string, 0),
60+
OmitEnv: false,
5961
})
6062
} else {
6163
c = konk.NewShellCommand(konk.ShellCommandConfig{
6264
Command: cmd,
6365
Label: labels[i],
6466
NoColor: noColor,
67+
Env: make([]string, 0),
68+
OmitEnv: false,
6569
})
6670
}
6771

@@ -74,7 +78,10 @@ var sCommand = cobra.Command{
7478
ctx, cancel := context.WithCancel(context.Background())
7579
defer cancel()
7680

77-
if err := c.Run(ctx, cancel, konk.RunCommandConfig{}); err != nil && continueOnError {
81+
if err := c.Run(ctx, cancel, konk.RunCommandConfig{
82+
AggregateOutput: false,
83+
StopOnCancel: false,
84+
}); err != nil && continueOnError {
7885
errCmd = err
7986
} else if err != nil {
8087
return fmt.Errorf("running command: %w", err)

konk/command.go

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func NewShellCommand(conf ShellCommandConfig) *Command {
4141

4242
return &Command{
4343
cmd: c,
44+
out: strings.Builder{},
4445
prefix: prefix,
4546
}
4647
}
@@ -69,6 +70,7 @@ func NewCommand(conf CommandConfig) *Command {
6970

7071
return &Command{
7172
cmd: cmd,
73+
out: strings.Builder{},
7274
prefix: prefix,
7375
}
7476
}

0 commit comments

Comments
 (0)