Skip to content

Instantly share code, notes, and snippets.

View Poincare's full-sized avatar

Dhaivat Pandya Poincare

View GitHub Profile
@Poincare
Poincare / gist:7865902
Last active December 30, 2015 18:09 — forked from anonymous/gist:7865898
export GOPATH=`pwd`
cd src
go get github.com/hoisie/web
package main
import (
"fmt"
)
/* added an interface */
type Animal interface {
Eat()
Sleep()
package main
import (
"github.com/hoisie/web"
)
func hello(val string) string {
return "hello " + val
}
go get github.com/hoisie/web
func FullDay(a Animal) {
a.Eat()
a.Sleep()
}
package main
import (
"fmt"
)
type Animal interface {
Eat()
Sleep()
}
package main
import (
"fmt"
)
type Horse struct {
name string
}
package main
type Horse struct {
name string
}
func main() {
}
class Horse implements Animal
#this is Pseudo-Ruby. We're pretending that Animal is an "interface"
#and Horse is a class.
def full_day(animal)
animal.eat()
animal.sleep()
end