Last active
March 7, 2016 16:38
-
-
Save lysu/6dfcc39e10f0156c5255 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* start prcess/process.go */ | |
package process | |
var fetch Fetch = fetch.NewHttpFetch() // as Gobal field | |
// or someone like this.. | |
// func int() { | |
// fetch = fetch.NewHttpFetch() | |
// } | |
func Process(x string) { | |
fetch.Fetch(x) | |
} | |
/* end prcess/process.go */ | |
/* start fetch/fetch.go */ | |
package fetch | |
type Fetch interface { | |
Fetch(x string) | |
} | |
type httpFetch struct { | |
} | |
// ............ | |
func NewHttpFetch() Fetch { | |
return &httpFetch | |
} | |
/* end fetch/fetch.go */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment