Skip to content

Commit

Permalink
fix golangci-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed Nov 8, 2024
1 parent 0163fa6 commit da1b6ec
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 8 additions & 0 deletions command/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func CmdCleanup(c *cli.Context) (err error) {
} else {
// undeploy all closed pull requests
var deployed []string

deployed, err = listDeployedPullRequests(listScript)
if err != nil {
return err
Expand All @@ -48,10 +49,13 @@ func CmdCleanup(c *cli.Context) (err error) {
if err != nil {
return err
}

openPRs := make([]string, len(prs))

for i, pr := range prs {
openPRs[i] = fmt.Sprintf("pr-%d", *pr.Number)
}

log.Println("open PRs:", openPRs)

// Now get a list of all the deployed PRs that are not open
Expand All @@ -72,7 +76,9 @@ func CmdCleanup(c *cli.Context) (err error) {
pullRequestID, err := strconv.Atoi(name)
if err != nil {
log.Println("Unable to parse pull request id: ", name)

lastErr = err

continue
}

Expand All @@ -83,7 +89,9 @@ func CmdCleanup(c *cli.Context) (err error) {
err = cmd.Run()
if err != nil {
log.Println("undeploy error: ", err)

lastErr = err

continue
}

Expand Down
7 changes: 0 additions & 7 deletions command/cleanup_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion command/please_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package command_test

import "testing"

func TestCmdPlease(t *testing.T) {
func TestCmdPlease(_ *testing.T) {
// Write your code here
}
16 changes: 8 additions & 8 deletions gitsrc/gitsrc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,34 @@ func (x *gitSource) String(name string) (string, error) {

// These are implemented to satisfy the altsrc.InputSourceContext interface

func (x *gitSource) Int(name string) (int, error) {
func (x *gitSource) Int(_ string) (int, error) {
return 0, ErrNotSupported
}

func (x *gitSource) Duration(name string) (time.Duration, error) {
func (x *gitSource) Float64(_ string) (float64, error) {
return 0, ErrNotSupported
}

func (x *gitSource) Float64(name string) (float64, error) {
func (x *gitSource) Duration(_ string) (time.Duration, error) {
return 0, ErrNotSupported
}

func (x *gitSource) StringSlice(name string) ([]string, error) {
func (x *gitSource) StringSlice(_ string) ([]string, error) {
return nil, ErrNotSupported
}

func (x *gitSource) IntSlice(name string) ([]int, error) {
func (x *gitSource) IntSlice(_ string) ([]int, error) {
return nil, ErrNotSupported
}

func (x *gitSource) Generic(name string) (cli.Generic, error) { //nolint:nolintlint,ireturn
func (x *gitSource) Generic(_ string) (cli.Generic, error) { //nolint:nolintlint,ireturn
return nil, ErrNotSupported
}

func (x *gitSource) Bool(name string) (bool, error) {
func (x *gitSource) Bool(_ string) (bool, error) {
return false, ErrNotSupported
}

func (x *gitSource) BoolT(name string) (bool, error) {
func (x *gitSource) BoolT(_ string) (bool, error) {
return false, ErrNotSupported
}
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ func main() {

if err := app.Run(os.Args); err != nil {
log.Fatal("ERROR:", err)
os.Exit(1)
}
}

0 comments on commit da1b6ec

Please sign in to comment.