alingse opened a new issue, #2762:
URL: https://github.com/apache/dubbo-go/issues/2762

   ### Environment
   
   <!-- 
   - Server: Dubbo-go, v3.0.5
   - Client: Dubbo-go, v3.0.5
   - Protocol: Triple
   - Registry: Nacos, v2.0.0
   -->
   
   - Server: 
   - Client: 
   - Protocol: 
   - Registry: 
   
   ### Issue description
   
   <!-- Here is a brief description about the issue. -->
   code 1 
   https://github.com/apache/dubbo-go/blob/main/config/tls_config.go#L88
   ```go
        caBytes, err := os.ReadFile(opt.CACertFile)
        if err != nil {
                return nil, err
        }
        if ok := ca.AppendCertsFromPEM(caBytes); !ok {
                return nil, err
        }
   ```
   the err is nil in line 88, here should define an error to return
   
   code 2
   
   
https://github.com/apache/dubbo-go/blob/main/protocol/triple/internal/client/common/client.go#L68
   
   
https://github.com/apache/dubbo-go/blob/main/protocol/triple/internal/client/common/client.go#L92
   
   ```go
        if sendErr := stream.Send(&greet.GreetStreamRequest{Name: "triple"}); 
sendErr != nil {
                return err
        }
   ```
   should return `sendErr` but return a nil value `err`
   
   I create a linter to detect code that returns a non-relevant nilness error 
bug. I checked the top 1000 GitHub Go repositories and found this, all result 
listed in https://github.com/alingse/sundrylint/issues/4
   
   ### Logs
   
   <details><summary>Click me to check logs</summary>
   
   ```
   Copy logs to here.
   ```
   
   </details>
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to