From: Andrew Balholm Date: Sat, 9 Jul 2011 22:10:39 +0000 (-0700) Subject: http: update triv.go with gofix X-Git-Tag: weekly.2011-07-19~147 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b053400e37a994b773694b6f428b54724168c8e1;p=gostls13.git http: update triv.go with gofix Sample code in triv.go wouldn't compile because it didn't use the new FileSystem interface. This was discussed on golang-nuts on July 7. https://groups.google.com/forum/#!topic/golang-nuts/NMhZk3Ft_Vc R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/4684044 --- diff --git a/src/pkg/http/triv.go b/src/pkg/http/triv.go index bff6a106d9..54b12333f5 100644 --- a/src/pkg/http/triv.go +++ b/src/pkg/http/triv.go @@ -138,7 +138,7 @@ func main() { expvar.Publish("counter", ctr) http.Handle("/", http.HandlerFunc(Logger)) - http.Handle("/go/", http.FileServer(*webroot, "/go/")) + http.Handle("/go/", http.StripPrefix("/go/", http.FileServer(http.Dir(*webroot)))) http.Handle("/flags", http.HandlerFunc(FlagServer)) http.Handle("/args", http.HandlerFunc(ArgServer)) http.Handle("/go/hello", http.HandlerFunc(HelloServer))