github.com/gomodule/redigo/redis

github.com/gomodule/redigo/redis

Redigo is a Go client for the Redis database.

Dial

Join Point
Call to redis.Dial
Advice
Replace the expression using the template:
// Using the following synthetic imports:
import (
	redigo "github.com/gomodule/redigo/redis"
	redigotrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gomodule/redigo"
)
func() (redigo.Conn, error) {
	{{ if .AST.Ellipsis }}
		opts := {{ index .AST.Args 2 }}
		anyOpts := make([]interface{}, len(opts))
		for i, v := range opts {
			anyOpts[i] = v
		}
		return redigotrace.Dial({{ index .AST.Args 0 }}, {{ index .AST.Args 1 }}, anyOpts...)
	{{ else }}
		return redigotrace.Dial(
			{{- range .AST.Args -}}
				{{ . }},
			{{- end -}}
		)
	{{ end }}
}()

DialContext

Join Point
Advice
Replace the expression using the template:
// Using the following synthetic imports:
import (
	redigo "github.com/gomodule/redigo/redis"
	redigotrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gomodule/redigo"
)
func() (redigo.Conn, error) {
	{{ if .AST.Ellipsis }}
		opts := {{ index .AST.Args 3 }}
		anyOpts := make([]interface{}, len(opts))
		for i, v := range opts {
			anyOpts[i] = v
		}
		return redigotrace.DialContext({{ index .AST.Args 0 }}, {{ index .AST.Args 1 }}, {{ index .AST.Args 2 }}, anyOpts...)
	{{ else }}
		return redigotrace.DialContext(
			{{- range .AST.Args -}}
				{{ . }},
			{{- end -}}
		)
	{{ end }}
}()

DialURL

Join Point
Advice
Replace the expression using the template:
// Using the following synthetic imports:
import (
	redigo "github.com/gomodule/redigo/redis"
	redigotrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gomodule/redigo"
)
func() (redigo.Conn, error) {
	{{ if .AST.Ellipsis }}
		opts := {{ index .AST.Args 1 }}
		anyOpts := make([]interface{}, len(opts))
		for i, v := range opts {
			anyOpts[i] = v
		}
		return redigotrace.DialURL({{ index .AST.Args 0 }}, anyOpts...)
	{{ else }}
		return redigotrace.DialURL(
			{{- range .AST.Args -}}
				{{ . }},
			{{- end -}}
		)
	{{ end }}
}()