Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 442 Bytes
package main
import (
"log"
"net/http"
)
type Comment struct {
User string
Text string
}
func main() {
//gistsnip:start:main
comments, err := NewComments("user=dbdemo password=dbdemo dbname=dbdemo sslmode=disable")
if err != nil {
log.Fatal(err)
}
server := NewServer(comments)
log.Println("Started listening on :8080")
if err := http.ListenAndServe(":8080", server); err != nil {
log.Fatal(err)
}
//gistsnip:end:main
}
You can’t perform that action at this time.