Skip to content

Instantly share code, notes, and snippets.

View Poincare's full-sized avatar

Dhaivat Pandya Poincare

View GitHub Profile
go get github.com/hoisie/web
package main
import (
"github.com/hoisie/web"
)
func hello(val string) string {
return "hello " + val
}
func FullDay(a Animal) {
a.Eat()
a.Sleep()
}
package main
import (
"fmt"
)
type Animal interface {
Eat()
Sleep()
}
package main
import (
"fmt"
)
/* added an interface */
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
package main
import (
"fmt"
)
var logChannel chan string = make(chan string)
func loggingLoop() {
for {