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

Remove leading whitespace #8

Closed
kalexmills opened this issue Nov 21, 2020 · 2 comments
Closed

Remove leading whitespace #8

kalexmills opened this issue Nov 21, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers vet-bot the issue is part of VetBot's responsibility
Milestone

Comments

@kalexmills
Copy link
Contributor

This is particularly annoying. github-vet/rangeloop-pointer-findings#308

Snippet quoted below:

					for _, p := range parallelisms {

						// Enable error count gathering
						var gotError chan bool
						var performed chan int
						var allDone chan bool

						if logFailedCalls {
							gotError = make(chan bool)
							performed = make(chan int)
							allDone = make(chan bool)
							go func() {
								errNb := 0
								totalNb := 0
								for {
									select {
									case <-allDone:
										results := float32(errNb) / float32(totalNb) * 100
										fmt.Printf("Benchmarking %s - %.00f%% error rate\n", fmt.Sprintf("%s/%v", r.Name, p), results)
										break
									case nb := <-performed:
										totalNb += nb
									case <-gotError:
										errNb++
									}
								}
							}()
						}

						b.Run(fmt.Sprintf("%s/%v", r.Name, p), func(b *testing.B) {
							b.SetParallelism(p)
							b.RunParallel(func(pb *testing.PB) {
								counter := 0
								for pb.Next() {
									if r.StreamsRequest && !r.StreamsReturns {
										err := benchStreamClient(b, action, currentService, r, tmpl)
										if err != nil {
											if logFailedCalls {
												gotError <- true
											}
										}
										counter = counter + b.N
									} else if !r.StreamsRequest && r.StreamsReturns {
										err := benchStreamServer(b, action, currentService, r, tmpl)
										if err != nil {
											if logFailedCalls {
												gotError <- true
												counter++
											}
										}
										counter = counter + b.N
									} else {
										err := benchCall(b, action, currentService, r, tmpl)
										if err != nil {
											if logFailedCalls {
												gotError <- true
											}
										}
										counter = counter + b.N
									}
								}
								if logFailedCalls {
									performed <- counter
								}
							})
						})
						if logFailedCalls {
							allDone <- true
						}
					}
@kalexmills kalexmills added enhancement New feature or request good first issue Good for newcomers track-bot the issue is part of TrackBot's responsibilities vet-bot the issue is part of VetBot's responsibility and removed track-bot the issue is part of TrackBot's responsibilities labels Nov 21, 2020
@kalexmills kalexmills added this to the General Availability milestone Dec 25, 2020
@kalexmills
Copy link
Contributor Author

This also could lead to duplicates in case of refactors that make changes to whitespace only.

@kalexmills
Copy link
Contributor Author

Closed by #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers vet-bot the issue is part of VetBot's responsibility
Projects
None yet
Development

No branches or pull requests

1 participant