Invalid import path: "github.com/go­--sql­--driver/mysql"

Hi All,

In my program I’ve included a line to import github.com/go-sql-driver/mysql

However, when running a go build for the program I receive this error invalid import path: "github.com/go­-sql­-driver/mysql"

import (
	"fmt"
	"os"
	"database/sql"
	"database/sql/driver"
	_ "github.com/go­-sql-­driver/mysql"
)

My env:

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\pt23\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Projects\Go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ptiernan\AppData\Local\Temp\go-build581625102=/tmp/go-build -gno-record-gcc-switches

I performed a go get -u github.com/go-sql-driver/mysql prior to all this.
Any help would be greatly appreciated.

Hi Patrick,

You are getting the error message because you used the wrong hyphens (dashes) in go-sql-driver. You need to make sure to use ASCII text or Unicode with code points less than 128.

Try this:

import (
        "fmt"
        "os"
        "database/sql"
        "database/sql/driver"
        _ "github.com/go-sql-driver/mysql"
)

Thank you for your response.
That was definitely the issue.

Thanks for the help!