]> Cypherpunks repositories - gostls13.git/commitdiff
rename the public exvar package to be expvar.
authorRob Pike <r@golang.org>
Wed, 30 Sep 2009 20:11:33 +0000 (13:11 -0700)
committerRob Pike <r@golang.org>
Wed, 30 Sep 2009 20:11:33 +0000 (13:11 -0700)
R=rsc
DELTA=684  (324 added, 324 deleted, 36 changed)
OCL=35161
CL=35163

src/pkg/Make.deps
src/pkg/Makefile
src/pkg/expvar/Makefile [moved from src/pkg/exvar/Makefile with 90% similarity]
src/pkg/expvar/expvar.go [moved from src/pkg/exvar/exvar.go with 95% similarity]
src/pkg/expvar/expvar_test.go [moved from src/pkg/exvar/exvar_test.go with 99% similarity]
src/pkg/http/triv.go

index 33631e668b31aa4cfb6f99ab3f3b5f7e31f8922e..1f85b2c398c57f92243137dd7eec06ae352875ec 100644 (file)
@@ -26,7 +26,7 @@ debug/gosym.install: debug/binary.install fmt.install os.install strconv.install
 debug/proc.install: container/vector.install fmt.install io.install os.install runtime.install strconv.install strings.install sync.install syscall.install
 ebnf.install: container/vector.install go/scanner.install go/token.install os.install strconv.install unicode.install utf8.install
 exec.install: os.install strings.install
-exvar.install: bytes.install fmt.install http.install log.install strconv.install sync.install
+expvar.install: bytes.install fmt.install http.install log.install strconv.install sync.install
 flag.install: fmt.install os.install strconv.install
 fmt.install: io.install os.install reflect.install strconv.install utf8.install
 go/ast.install: go/token.install unicode.install utf8.install
index ad2b7828d2d3603ff1af09a9f8d57e47349bbefb..6dd11f93e3a61eeff39b88c83d4b6364dd8e388f 100644 (file)
@@ -40,7 +40,7 @@ DIRS=\
        debug/proc\
        ebnf\
        exec\
-       exvar\
+       expvar\
        flag\
        fmt\
        go/ast\
similarity index 90%
rename from src/pkg/exvar/Makefile
rename to src/pkg/expvar/Makefile
index 795e8a644391259bac0df45eb0e9c672b4c0eea5..49e8de6d1fecabcb28888a6770f0c23ee39fb120 100644 (file)
@@ -4,8 +4,8 @@
 
 include $(GOROOT)/src/Make.$(GOARCH)
 
-TARG=exvar
+TARG=expvar
 GOFILES=\
-       exvar.go\
+       expvar.go\
 
 include $(GOROOT)/src/Make.pkg
similarity index 95%
rename from src/pkg/exvar/exvar.go
rename to src/pkg/expvar/expvar.go
index 479154850523783ee4bdd5328e3b66ac485ed100..9d04a427cd2301c13243066dc6f6a8dd7c67a88a 100644 (file)
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// The exvar package provides a standardized interface to public variables,
+// The expvar package provides a standardized interface to public variables,
 // such as operation counters in servers. It exposes these variables via
 // HTTP at /debug/vars in JSON format.
-package exvar
+package expvar
 
 import (
        "bytes";
@@ -203,7 +203,7 @@ func Iter() <-chan KeyValue {
        return c
 }
 
-func exvarHandler(c *http.Conn, req *http.Request) {
+func expvarHandler(c *http.Conn, req *http.Request) {
        c.SetHeader("content-type", "application/json; charset=utf-8");
        fmt.Fprintf(c, "{\n");
        first := true;
@@ -218,5 +218,5 @@ func exvarHandler(c *http.Conn, req *http.Request) {
 }
 
 func init() {
-       http.Handle("/debug/vars", http.HandlerFunc(exvarHandler));
+       http.Handle("/debug/vars", http.HandlerFunc(expvarHandler));
 }
similarity index 99%
rename from src/pkg/exvar/exvar_test.go
rename to src/pkg/expvar/expvar_test.go
index eddbbf9e28b2860d708659db6dd9286fb2482d08..1f3e3d686df4a1503bf1b69aca41619b570e91c5 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package exvar
+package expvar
 
 import (
        "json";
index 900dcbb5b963533ca3b2cfae8bd402088d50bb39..0c74aed123e988a19fe4397c78c91e3b2ef93320 100644 (file)
@@ -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));