Created
November 1, 2015 07:27
-
-
Save nodirt/7d085fe5f207b8502142 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package main | |
import ( | |
"better" | |
"log" | |
) | |
// Logger is a subset of log.Logger methods that we need. | |
type MyLogger interface { | |
Print(v ...interface{}) | |
} | |
func do(l MyLogger) { | |
l.Print("doing...") | |
} | |
func main() { | |
do(log.New(os.Stdout, "", 0)) | |
do(&better.Logger{}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment