summaryrefslogtreecommitdiff
path: root/src/pkg/http/triv.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-09-30 13:11:33 -0700
committerRob Pike <r@golang.org>2009-09-30 13:11:33 -0700
commitcea1e9d746c5013b6566fac3a06f817626fbcae1 (patch)
tree3cf48014a854d9ceee474a3c4628bcb714dbf8c9 /src/pkg/http/triv.go
parent11f8e08cd3bf0ffd20e50380014cf210f028da03 (diff)
downloadgolang-cea1e9d746c5013b6566fac3a06f817626fbcae1.tar.gz
rename the public exvar package to be expvar.
R=rsc DELTA=684 (324 added, 324 deleted, 36 changed) OCL=35161 CL=35163
Diffstat (limited to 'src/pkg/http/triv.go')
-rw-r--r--src/pkg/http/triv.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/http/triv.go b/src/pkg/http/triv.go
index 900dcbb5b..0c74aed12 100644
--- a/src/pkg/http/triv.go
+++ b/src/pkg/http/triv.go
@@ -7,7 +7,7 @@ package main
import (
"bytes";
"bufio";
- "exvar";
+ "expvar";
"flag";
"fmt";
"io";
@@ -19,7 +19,7 @@ import (
// hello world, the web server
-var helloRequests = exvar.NewInt("hello-requests");
+var helloRequests = expvar.NewInt("hello-requests");
func HelloServer(c *http.Conn, req *http.Request) {
helloRequests.Add(1);
io.WriteString(c, "hello, world!\n");
@@ -30,7 +30,7 @@ type Counter struct {
n int;
}
-// This makes Counter satisfy the exvar.Var interface, so we can export
+// This makes Counter satisfy the expvar.Var interface, so we can export
// it directly.
func (ctr *Counter) String() string {
return fmt.Sprintf("%d", ctr.n)
@@ -56,7 +56,7 @@ func (ctr *Counter) ServeHTTP(c *http.Conn, req *http.Request) {
// simple file server
var webroot = flag.String("root", "/home/rsc", "web root directory")
-var pathVar = exvar.NewMap("file-requests");
+var pathVar = expvar.NewMap("file-requests");
func FileServer(c *http.Conn, req *http.Request) {
c.SetHeader("content-type", "text/plain; charset=utf-8");
pathVar.Add(req.Url.Path, 1);
@@ -143,7 +143,7 @@ func main() {
// The counter is published as a variable directly.
ctr := new(Counter);
http.Handle("/counter", ctr);
- exvar.Publish("counter", ctr);
+ expvar.Publish("counter", ctr);
http.Handle("/go/", http.HandlerFunc(FileServer));
http.Handle("/flags", http.HandlerFunc(FlagServer));