jiekun commented on PR #55:
URL: https://github.com/apache/skywalking-go/pull/55#issuecomment-1579722404

   > You need to add the `-work` parameter and see what's happening in there.
   
   Thanks. I did it yesterday and I am going to post the source file and 
generated file here as below:
   ```go
           // source
   
        switch c := rdb.(type) {
        case *redis.Client:
                c.AddHook(newRedisHook(c.Options().Addr))
        case *redis.ClusterClient:
                c.AddHook(newRedisHook(""))
   
                c.OnNewNode(func(rdb *redis.Client) {
                        rdb.AddHook(newRedisHook(rdb.Options().Addr))
                })
        case *redis.Ring:
                c.AddHook(newRedisHook(""))
   
                c.OnNewNode(func(rdb *redis.Client) {
                        rdb.AddHook(newRedisHook(rdb.Options().Addr))
                })
   ```
   
   ```go
           // generated
   
        switch c := rdb.(type) {
        case *redis.Client:
                
c.AddHook(skywalking_operatorStaticMethodRedisnewRedisHook(c.Options().Addr))
        case *redis.ClusterClient:
                c.AddHook(skywalking_operatorStaticMethodRedisnewRedisHook(""))
   
                c.OnNewNode(func(rdb *Client) {
                        
rdb.AddHook(skywalking_operatorStaticMethodRedisnewRedisHook(rdb.Options().Addr))
                })
        case *redis.Ring:
                c.AddHook(skywalking_operatorStaticMethodRedisnewRedisHook(""))
   
                c.OnNewNode(func(rdb *Client) {
                        
rdb.AddHook(skywalking_operatorStaticMethodRedisnewRedisHook(rdb.Options().Addr))
                })
   ```
   
   The `*redis` in `switch-case` line is not replaced. Initially I thought it's 
because those structure are not instrumented. However same struct in function 
call is replaced (e.g. `c.OnNewNode(func(rdb *redis.Client) {` is replaced to 
`c.OnNewNode(func(rdb *Client) {`). Any clue @mrproliu ?
   


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