]> Cypherpunks repositories - gostls13.git/commitdiff
http: update triv.go with gofix
authorAndrew Balholm <andybalholm@gmail.com>
Sat, 9 Jul 2011 22:10:39 +0000 (15:10 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 9 Jul 2011 22:10:39 +0000 (15:10 -0700)
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

src/pkg/http/triv.go

index bff6a106d972928258c813203612a786daf423e4..54b12333f589ae069177008068b722c6566ff001 100644 (file)
@@ -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))