You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
405 B
Go

8 years ago
package main
import (
"flag"
"fmt"
"net/http"
"os"
)
var options struct {
Host string
}
func init() {
flag.StringVar(&options.Host, "host", "0.0.0.0:8000", "http hostname:port to listen on")
}
func main() {
flag.Parse()
8 years ago
8 years ago
s := server{
out: os.Stdout,
errors: os.Stderr,
}
8 years ago
8 years ago
if err := http.ListenAndServe(options.Host, &s); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
}
}