Commit 62c29ce
authored
Allow to change (or disable) the default driver name for registration (#1499)
A link variable now allows to change or disable the name of the driver
that is automatically registered with database/sql:
Change driver name:
go build "-ldflags=-X github.com/go-sql-driver/mysql.driverName=custom"
Disable driver registration (set driverName to empty string):
go build "-ldflags=-X github.com/go-sql-driver/mysql.driverName="
In the same way, a variable overridable at link time is also provided to
override the driver name used in the test suite. This allows to run our
test suite on another driver.
go test "-ldflags=-X github.com/go-sql-driver/mysql.driverNameTest=custom"
driverName is propagated to driverNameTest unless driverNameTest is
explicitely defined.1 parent 1e6b8d7 commit 62c29ce
3 files changed
+30
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
93 | 97 | | |
94 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | | - | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| |||
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | | - | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| |||
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
144 | | - | |
| 154 | + | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
| |||
1917 | 1927 | | |
1918 | 1928 | | |
1919 | 1929 | | |
1920 | | - | |
| 1930 | + | |
1921 | 1931 | | |
1922 | 1932 | | |
1923 | 1933 | | |
| |||
1956 | 1966 | | |
1957 | 1967 | | |
1958 | 1968 | | |
1959 | | - | |
| 1969 | + | |
1960 | 1970 | | |
1961 | 1971 | | |
1962 | 1972 | | |
| |||
2054 | 2064 | | |
2055 | 2065 | | |
2056 | 2066 | | |
2057 | | - | |
| 2067 | + | |
2058 | 2068 | | |
2059 | 2069 | | |
2060 | 2070 | | |
| |||
2243 | 2253 | | |
2244 | 2254 | | |
2245 | 2255 | | |
2246 | | - | |
| 2256 | + | |
2247 | 2257 | | |
2248 | 2258 | | |
2249 | 2259 | | |
| |||
3210 | 3220 | | |
3211 | 3221 | | |
3212 | 3222 | | |
3213 | | - | |
| 3223 | + | |
3214 | 3224 | | |
3215 | 3225 | | |
3216 | 3226 | | |
| |||
3375 | 3385 | | |
3376 | 3386 | | |
3377 | 3387 | | |
3378 | | - | |
| 3388 | + | |
3379 | 3389 | | |
3380 | 3390 | | |
3381 | 3391 | | |
| |||
0 commit comments