Skip to content

Commit

Permalink
Update driver name after ASF donation
Browse files Browse the repository at this point in the history
patch by Bret McGuire; reviewed by Joao Reis, Martin Sucha, Bret McGuire
reference: #1817
  • Loading branch information
absurdfarce committed Sep 10, 2024
1 parent 8194fec commit ce76a83
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,8 +44,8 @@ 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 d.Replace != nil {
driverName = d.Replace.Path
Expand Down

0 comments on commit ce76a83

Please sign in to comment.