MCPcopy
hub / github.com/go-sql-driver/mysql / writeDSNParam

Function writeDSNParam

dsn.go:236–247  ·  view source on GitHub ↗
(buf *bytes.Buffer, hasParam *bool, name, value string)

Source from the content-addressed store, hash-verified

234}
235
236func 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.

Callers 1

FormatDSNMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected