Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Created December 16, 2014 13:11
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 ngauthier/dd460f72d954c3bd654b to your computer and use it in GitHub Desktop.
Save ngauthier/dd460f72d954c3bd654b to your computer and use it in GitHub Desktop.
go dep inj via interface and constructor
package athena
import (
accountant "codeship-accountant",
janus "codeship-janus",
ares "ares-api"
)
func main() {
// codeship accountant implements accountant interface
accountant := accountant.New()
// codeship janus implements janus interface
janus := janus.New()
// this is a general purpose ares api for stuff or whatever
ares := ares.New()
athena.New(accountant, janus, ares)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment