File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,13 @@ package gocql
2727import "runtime/debug"
2828
2929const (
30- mainModule = "github.com/gocql/gocql"
30+ defaultDriverName = "github.com/apache/cassandra-gocql-driver"
31+
32+ // This string MUST have this value since we explicitly test against the
33+ // current main package returned by runtime/debug below. Also note the
34+ // package name used here may change in a future (2.x) release; in that case
35+ // this constant will be updated as well.
36+ mainPackage = "github.com/gocql/gocql"
3137)
3238
3339var driverName string
@@ -38,9 +44,13 @@ func init() {
3844 buildInfo , ok := debug .ReadBuildInfo ()
3945 if ok {
4046 for _ , d := range buildInfo .Deps {
41- if d .Path == mainModule {
42- driverName = mainModule
47+ if d .Path == mainPackage {
48+ driverName = defaultDriverName
4349 driverVersion = d .Version
50+ // If there's a replace directive in play for the gocql package
51+ // then use that information for path and version instead. This
52+ // will allow forks or other local packages to clearly identify
53+ // themselves as distinct from mainPackage above.
4454 if d .Replace != nil {
4555 driverName = d .Replace .Path
4656 driverVersion = d .Replace .Version
You can’t perform that action at this time.
0 commit comments