xujianhai666 opened a new pull request #83: Feat golangci
URL: https://github.com/apache/rocketmq-client-go/pull/83
 
 
   ## What is the purpose of the change
   
   use golangci to improve code quality. for example, the code like below is 
extra.
   `return i == nil || len(i) == 0`
   we just write like below is okay:
   `return len(i) == 0`
   Besides, some hidden danger also exists, race condition is obvious as below
   ```
   func (c *consumer) run(args []string) {
           wg := sync.WaitGroup{}
           go func() {
                  wg.Add(1)
                   c.consumeMsg(&stati, exitChan)
                   wg.Done()
           }()
   ```
   
   the correct code is as below:
   ```
   func (c *consumer) run(args []string) {
           wg := sync.WaitGroup{}
   
           wg.Add(1)
           go func() {
                   c.consumeMsg(&stati, exitChan)
                   wg.Done()
           }()
   ```
   ## Brief changelog
   
   1. add .golangci file, for golangci tools
   2. update code due to code analysis, but the work is too heavy, and I found 
that the code is not done completely, such as "TODO" comment is code block, so 
I just break it.
   
   ## Verifying this change
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to