Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 080f49b

Browse files
author
Philippe Lafoucrière
committed
Fix error message
1 parent 3bc76ee commit 080f49b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

driver/driver.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package driver
33

44
import (
5-
"errors"
65
"fmt"
76
neturl "net/url" // alias to allow `url string` func signature in New
87
"reflect"
@@ -49,8 +48,7 @@ func New(url string) (Driver, error) {
4948
blankDriver := reflect.New(reflect.TypeOf(driver)).Interface()
5049
d, ok := blankDriver.(Driver)
5150
if !ok {
52-
err := errors.New(fmt.Sprintf("Driver '%s' does not implement the Driver interface"))
53-
return nil, err
51+
return nil, fmt.Errorf("Driver '%s' does not implement the Driver interface", u.Scheme)
5452
}
5553
verifyFilenameExtension(u.Scheme, d)
5654
if err := d.Initialize(url); err != nil {

0 commit comments

Comments
 (0)