initial import

This commit is contained in:
SourceFellows
2020-08-21 06:26:40 +02:00
commit e223458dd4
423 changed files with 9871 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package main
import (
"fmt"
)
type Logger interface {
Log(message string)
}
type LoggerFunc func(message string)
func (l LoggerFunc) Log(message string) {
l(message)
}
func MyLogFunc(message string) {
fmt.Printf("I log %s\n", message)
}
func myMethodTakesTheLog(l Logger) {
l.Log("my log message")
}
func main() {
logger := LoggerFunc(MyLogFunc)
myMethodTakesTheLog(logger)
}