This is an automated email from the ASF dual-hosted git repository.

absurdfarce pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-gocql-driver.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5ed5e6d  Update driver name after ASF donation
5ed5e6d is described below

commit 5ed5e6dcaa69f5329522be429e0546bc848b8aa2
Author: absurdfarce <[email protected]>
AuthorDate: Thu Sep 5 11:44:24 2024 -0500

    Update driver name after ASF donation
    
    patch by Bret McGuire; reviewed by Joao Reis, Martin Sucha, Andy Tolbert 
and James Hartig
    reference: https://github.com/apache/cassandra-gocql-driver/pull/1817
---
 version.go | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/version.go b/version.go
index 140bae8..f2250f7 100644
--- a/version.go
+++ b/version.go
@@ -27,7 +27,13 @@ package gocql
 import "runtime/debug"
 
 const (
-       mainModule = "github.com/gocql/gocql"
+       defaultDriverName = "github.com/apache/cassandra-gocql-driver"
+
+       // This string MUST have this value since we explicitly test against the
+       // current main package returned by runtime/debug below.  Also note the
+       // package name used here may change in a future (2.x) release; in that 
case
+       // this constant will be updated as well.
+       mainPackage = "github.com/gocql/gocql"
 )
 
 var driverName string
@@ -38,9 +44,13 @@ func init() {
        buildInfo, ok := debug.ReadBuildInfo()
        if ok {
                for _, d := range buildInfo.Deps {
-                       if d.Path == mainModule {
-                               driverName = mainModule
+                       if d.Path == mainPackage {
+                               driverName = defaultDriverName
                                driverVersion = d.Version
+                               // If there's a replace directive in play for 
the gocql package
+                               // then use that information for path and 
version instead.  This
+                               // will allow forks or other local packages to 
clearly identify
+                               // themselves as distinct from mainPackage 
above.
                                if d.Replace != nil {
                                        driverName = d.Replace.Path
                                        driverVersion = d.Replace.Version


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

Reply via email to