henesy / go9p

Automatically exported from code.google.com/p/go9p
Other
1 stars 0 forks source link

stats_http.go files built on default #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Before revision 102:49cad2d4591a (2 days ago) some source files,
p/clnt/stats_http.go and p/srv/stats_http.go, would not be
built on default, as Makefiles contained lines like:

    STATS=
    #STATS=stats_http.go

    GOFILES=\
        ...\
        $(STATS)\

As a result, net/http package, which is used in stats_http.go,
would have been linked into a go9p program only if STATS was
set to the non-default value.

Makefiles vanished as a part of the transition to the Go build
tool; now all go files within p/clnt and p/srv will be built
on default, i.e. also stats_http.go. I suggest to add a line to
the top of each of the stats_http.go files:

 // +build ignore

which would exclude them from being built on default.
This would restore the old behavior and avoid net/http being
linked into each program using go9p. Users that want to use
the statistics could remove these lines temporarily.

Unrelated to the issue above, though related to stats_http.go,
i.e. the use of http.Handle() in statsUnregister() functions:

It seems that unregistering a Handle by specifying
a nil pointer is no longer possible since Go revision
11785:d739d7e8b0e6: "net/http: panic on duplicate
registrations". Now net/http will panic in such a case.
(I don't know if there is a way to unregister a http.Handle at all
...)

Michael

Original issue reported on code.google.com by mt4...@googlemail.com on 13 Feb 2012 at 1:50

GoogleCodeExporter commented 9 years ago
fixed with go build. 

Original comment by mirtchov...@gmail.com on 27 Mar 2012 at 4:54