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 wasted assigns #3506

Merged
merged 1 commit into from Mar 13, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -244,10 +244,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