Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some using gosec #20

Merged
merged 2 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmd/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ var launchCmd = &cobra.Command{
c := exec.Command(trackCommand[0], trackCommand[1:]...)
envs = append(envs, fmt.Sprintf("PID=%s", pidStr))
c.Env = envs
c.Start()
err = c.Start()
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}

fmt.Printf("%s %s\n", color.Magenta("Launched:", color.B), strings.Join(trackCommand, " "))
},
Expand Down
5 changes: 4 additions & 1 deletion cmd/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ func optionSlackChannel(slackChannel string, nonInteractive bool) (option, error
_, _ = fmt.Fprintf(os.Stderr, "%s\n", errors.New("Invalid URL"))
return optionSlackChannel(slackChannel, nonInteractive)
}
os.Setenv("SLACK_INCOMMING_WEBHOOK_URL", url)
err := os.Setenv("SLACK_INCOMMING_WEBHOOK_URL", url)
if err != nil {
return option{}, err
}
}
slackChannel = prompter.Prompt("Enter slack channel", slackChannel)
fmt.Println("")
Expand Down
5 changes: 4 additions & 1 deletion cmd/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ func notifySlack(webhookURL string, slackChannel string, slackMention string, tr
}
attachment.Footer = hostname
payload.AddAttachment(&attachment)
slack.Client{
err := slack.Client{
WebhookURL: webhookURL,
}.Post(&payload)
if err != nil {
return err
}
return nil
}
}
1 change: 1 addition & 0 deletions metrics/metrics_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build linux

package metrics

import (
Expand Down