Skip to content

Instantly share code, notes, and snippets.

@jeremylowery
Created March 16, 2017 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremylowery/920d8c62bc7daa3bf49c5d508c22f6bf to your computer and use it in GitHub Desktop.
Save jeremylowery/920d8c62bc7daa3bf49c5d508c22f6bf to your computer and use it in GitHub Desktop.
// Provider interface for your object
type PatientProvider interface {
PatientByID(id int) Patient
  InactivePatients() []Patient
}
// Dependency interface needed by object
type SQLExecutor interface {
ExecuteSQL(sql string) []SQLRecord
}
// Given for completeness
type Patient struct {
Id int
name string
}
type SQLRecord []interface{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment