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

Bug Report: append slice all items when range it #948

Open
alingse opened this issue May 28, 2024 · 0 comments
Open

Bug Report: append slice all items when range it #948

alingse opened this issue May 28, 2024 · 0 comments

Comments

@alingse
Copy link

alingse commented May 28, 2024

I was running github actions to run linter sundrylint for top github golang repos.

see issues alingse/go-linter-runner#3

and the github actions output https://github.com/alingse/go-linter-runner/actions/runs/9273043532/job/25512239384

====================================================================================================
https://github.com/open2b/scriggo/blob/main/internal/compiler/emitter.go#L148:14: append all its data while range it
====================================================================================================
			// Do not add duplicated init functions.
			for _, pkgInit := range pkgInits {
				add := true
				for _, ini := range inits {
					if ini == pkgInit {
						add = false
						break
					}
				}
				if add {
					inits = append(inits, pkgInits...)
				}
			}

the inits = append(inits, pkgInits...) should be inits = append(inits, pkgInit)

@alingse alingse changed the title Bug Report: append all items when range it Bug Report: append slice all items when range it May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant