Function
writeDSNParam
(buf *bytes.Buffer, hasParam *bool, name, value string)
Source from the content-addressed store, hash-verified
| 234 | } |
| 235 | |
| 236 | func writeDSNParam(buf *bytes.Buffer, hasParam *bool, name, value string) { |
| 237 | buf.Grow(1 + len(name) + 1 + len(value)) |
| 238 | if !*hasParam { |
| 239 | *hasParam = true |
| 240 | buf.WriteByte('?') |
| 241 | } else { |
| 242 | buf.WriteByte('&') |
| 243 | } |
| 244 | buf.WriteString(name) |
| 245 | buf.WriteByte('=') |
| 246 | buf.WriteString(value) |
| 247 | } |
| 248 | |
| 249 | // FormatDSN formats the given Config into a DSN string which can be passed to |
| 250 | // the driver. |
Tested by
no test coverage detected