Skip to content

Instantly share code, notes, and snippets.

@svalleru
Last active October 16, 2015 19:38
Show Gist options
  • Save svalleru/37a3552296f338ff48c1 to your computer and use it in GitHub Desktop.
Save svalleru/37a3552296f338ff48c1 to your computer and use it in GitHub Desktop.
Simplae Interface & Struct in Go
package main
import "fmt"
type Awesomizer interface {
Awesomize() string
}
type Foo struct{}
func (foo Foo) Awesomize() string {
return "Awesome!"
}
func main() {
f := Foo{}
fmt.Println(f.Awesomize())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment