Browse Source

s/util/mutil/

"util" is a really bad name for a package since it isn't very
descriptive and so often collides with other names.

Unfortunately, this is a breaking change, but it's both very easy to fix
and perhaps more importantly also better to do now than later.
Carl Jackson 11 years ago
parent
commit
2ca8864e18
4 changed files with 9 additions and 9 deletions
  1. +3
    -3
      web/middleware/logger.go
  2. +3
    -0
      web/mutil/mutil.go
  3. +3
    -3
      web/mutil/writer_proxy.go
  4. +0
    -3
      web/util/util.go

+ 3
- 3
web/middleware/logger.go View File

@ -7,7 +7,7 @@ import (
"time"
"github.com/zenazn/goji/web"
"github.com/zenazn/goji/web/util"
"github.com/zenazn/goji/web/mutil"
)
// Logger is a middleware that logs the start and end of each request, along
@ -29,7 +29,7 @@ func Logger(c *web.C, h http.Handler) http.Handler {
printStart(reqID, r)
lw := util.WrapWriter(w)
lw := mutil.WrapWriter(w)
t1 := time.Now()
h.ServeHTTP(lw, r)
@ -60,7 +60,7 @@ func printStart(reqID string, r *http.Request) {
log.Print(buf.String())
}
func printEnd(reqID string, w util.WriterProxy, dt time.Duration) {
func printEnd(reqID string, w mutil.WriterProxy, dt time.Duration) {
var buf bytes.Buffer
if reqID != "" {


+ 3
- 0
web/mutil/mutil.go View File

@ -0,0 +1,3 @@
// Package mutil contains various functions that are helpful when writing http
// middleware.
package mutil

web/util/writer_proxy.go → web/mutil/writer_proxy.go View File


+ 0
- 3
web/util/util.go View File

@ -1,3 +0,0 @@
// Package util contains various functions that are helpful when writing http
// middleware.
package util

Loading…
Cancel
Save