Suhail98 commented on PR #6832:
URL: https://github.com/apache/camel-k/pull/6832#issuecomment-5764546221

   Checked before changing anything, and the tagalign errors are only part of 
that run. It reports three:
   
   ```
   pkg/cmd/root.go:55:45: G118: context cancellation function returned by 
WithCancel/WithTimeout/WithDeadline is not called (gosec)
   pkg/cmd/run.go:127:19: tag is not aligned, should be: 
mapstructure:"use-flows"   yaml:",omitempty" (tagalign)
   pkg/cmd/run.go:128:19: tag is not aligned, should be: kamel:"omitsave"       
    mapstructure:"save" yaml:",omitempty" (tagalign)
   ```
   
   `gofmt` does not fix either kind. At the commit that run tested, `gofmt -l 
pkg/cmd/` is silent: tagalign aligns the keys *inside* the tag, which gofmt 
leaves alone, so it takes `make lint-fix` or the same alignment by hand, which 
is what the tag commit does. G118 is fallout from the removal itself, since 
`syncIntegration` held the only call to `ContextCancel` and the cancel func 
from `WithCancel` is now never called.
   
   You were right that the commit went too far, though. It also deleted 
`RootContext` and moved the wait point in `run.go`, which was more than the 
error needed. I dropped it and pushed a smaller one: the child context and the 
unused `ContextCancel` field go, `RootContext` keeps its meaning, and `run.go` 
is untouched.
   
   Verified with golangci-lint v2.13.2 and the repo config: `pkg/cmd` is clean 
apart from pre-existing `mnd` findings in files this PR does not touch.
   
   Happy to drop that commit too if you would rather fix G118 separately from 
this one.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to