Repository navigation
Commit 63f07d0
committed
db: forge sqlite URLs rejected by url.Parse
Go 1.26.0's net/url regressed and rejects the ":memory:" authority of
"sqlite://:memory:" as an invalid port. GitHub's setup-go installs the
exact version from the go directive, so CI runs on 1.26.0 and fails to
open the in-memory test database even though later 1.26.x releases parse
it fine.
Keep url.Parse as the normal path and, when it fails on a sqlite or
sqlite3 DSN, rebuild the URL by hand the way a lenient parser would.
This works on every Go version without pinning the toolchain.
Signed-off-by: Robin Jarry <robin@jarry.cc>1 parent ff090e8 commit 63f07d0
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| |||
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
125 | 154 | | |
126 | 155 | | |
127 | 156 | | |
| |||
0 commit comments