Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tptacek
on March 20, 2018
|
parent
|
context
|
favorite
| on:
How to Use Go Interfaces
context also returns context.Context (an interface), and sql returns driver.Value, an interface.
dsymonds
on March 20, 2018
[–]
context.Context is an interface because it is known there are multiple implementers (several in the context package itself). The sql driver.Value is actually the other way around: the sql package is the consuming package (for the driver).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: