Skip to content

Commit

Permalink
Address some linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Dementyev committed Oct 16, 2023
1 parent c00f6f7 commit 0fef582
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ If deployment failed, then rolls back to the previous stack definition.`,
func init() {
rootCmd.AddCommand(deployCmd)
deployCmd.PersistentFlags().StringSliceP("service", "s", []string{}, "Names of services to update. Can be specified multiple times for parallel deployment")
viper.BindPFlag("deploy.services", deployCmd.PersistentFlags().Lookup("service"))
if err := viper.BindPFlag("deploy.services", deployCmd.PersistentFlags().Lookup("service")); err != nil {
log.WithError(err).Fatal("can't bind flag to config")
}
}
4 changes: 1 addition & 3 deletions lib/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,5 @@ func ConnectSSH(profile, cluster, taskDefinitionName, containerName, shell, serv

env := os.Environ()

syscall.Exec("/usr/bin/ssh", params, env)

return 0, nil
return 0, syscall.Exec("/usr/bin/ssh", params, env)
}
12 changes: 9 additions & 3 deletions lib/ssm.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ func runProcessor(value string, command []string) (string, error) {
}
go func() {
defer stdin.Close()
io.WriteString(stdin, value)
if _, err := io.WriteString(stdin, value); err != nil {
log.WithError(err).Error("can't write to stdin of the command")
}
}()

stdout, err := cmd.StdoutPipe()
Expand All @@ -73,7 +75,9 @@ func runProcessor(value string, command []string) (string, error) {
}
go func() {
defer stdout.Close()
io.Copy(output, stdout)
if _, err := io.Copy(output, stdout); err != nil {
log.WithError(err).Error("can't write the command's stdout to output")
}
}()

stderr, err := cmd.StderrPipe()
Expand All @@ -82,7 +86,9 @@ func runProcessor(value string, command []string) (string, error) {
}
go func() {
defer stderr.Close()
io.Copy(os.Stderr, stderr)
if _, err := io.Copy(os.Stderr, stderr); err != nil {
log.WithError(err).Error("can't write the command's stderr to stderr")
}
}()

if err := cmd.Start(); err != nil {
Expand Down

0 comments on commit 0fef582

Please sign in to comment.