Skip to content

Commit

Permalink
Merge pull request #3506 from saschagrunert/wasted-assigns
Browse files Browse the repository at this point in the history
Fix wasted assigns
  • Loading branch information
k8s-ci-robot committed Mar 13, 2024
2 parents a826e65 + 27c5c86 commit ae05b02
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Expand Up @@ -81,6 +81,7 @@ linters:
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
# - containedctx
Expand Down Expand Up @@ -120,7 +121,6 @@ linters:
# - thelper
# - tparallel
# - varnamelen
# - wastedassign
# - wrapcheck
# - wsl
linters-settings:
Expand Down
3 changes: 1 addition & 2 deletions cmd/krel/cmd/release_notes.go
Expand Up @@ -1122,7 +1122,6 @@ func fixReleaseNotes(workDir string, releaseNotes *notes.ReleaseNotes) error {
// Cycle all gathered release notes
for pr, note := range releaseNotes.ByPR() {
contentHash, err := note.ContentHash()
noteReviewed := false
if err != nil {
return fmt.Errorf("getting the content hash for PR#%d: %w", pr, err)
}
Expand Down Expand Up @@ -1190,7 +1189,7 @@ func fixReleaseNotes(workDir string, releaseNotes *notes.ReleaseNotes) error {
return fmt.Errorf("while asking to edit release note: %w", err)
}

noteReviewed = true
noteReviewed := true
if choice {
for {
retry, err := editReleaseNote(pr, workDir, originalNote, note)
Expand Down
3 changes: 1 addition & 2 deletions pkg/consts/main.go
Expand Up @@ -71,9 +71,8 @@ const (
func IsSupported(field string, input, expected []string) bool {
notSupported := []string{}

supported := false
for _, i := range input {
supported = false
supported := false
for _, j := range expected {
if i == j {
supported = true
Expand Down
6 changes: 2 additions & 4 deletions pkg/fastforward/fastforward.go
Expand Up @@ -246,10 +246,8 @@ func (f *FastForward) Run() (err error) {

prepushMessage(f.RepoDir(repo), f.options.GitHubOrg, f.options.GitHubRepo, branch, f.options.MainRef, releaseRev, headRev)

pushUpstream := false
if f.options.NonInteractive {
pushUpstream = true
} else {
pushUpstream := f.options.NonInteractive
if !pushUpstream {
_, pushUpstream, err = f.Ask(pushUpstreamQuestion, "yes", 3)
if err != nil {
return fmt.Errorf("ask upstream question: %w", err)
Expand Down

0 comments on commit ae05b02

Please sign in to comment.