Rename a bunch of "Make" functions to "New"

Also rename some to other names that make better reading.  There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things.  It seemed that "make" there seemed fine.  "New"
is for "constructors".
This commit is contained in:
Tim Hockin
2014-08-20 21:27:19 -07:00
parent 953cd923f1
commit 0f97a73c1b
33 changed files with 217 additions and 217 deletions

View File

@@ -65,19 +65,19 @@ func TestStatusIsNot(t *testing.T) {
}
}
func TestMakeLogged(t *testing.T) {
func TestNewLogged(t *testing.T) {
req, err := http.NewRequest("GET", "http://example.com", nil)
if err != nil {
t.Errorf("Unexpected error: %v", err)
}
handler := func(w http.ResponseWriter, r *http.Request) {
MakeLogged(req, &w)
NewLogged(req, &w)
defer func() {
if r := recover(); r == nil {
t.Errorf("Expected MakeLogged to panic")
t.Errorf("Expected NewLogged to panic")
}
}()
MakeLogged(req, &w)
NewLogged(req, &w)
}
w := httptest.NewRecorder()
handler(w, req)
@@ -93,7 +93,7 @@ func TestLogOf(t *testing.T) {
handler := func(w http.ResponseWriter, r *http.Request) {
var want *respLogger
if makeLogger {
want = MakeLogged(req, &w)
want = NewLogged(req, &w)
} else {
defer func() {
if r := recover(); r == nil {
@@ -121,7 +121,7 @@ func TestUnlogged(t *testing.T) {
handler := func(w http.ResponseWriter, r *http.Request) {
want := w
if makeLogger {
MakeLogged(req, &w)
NewLogged(req, &w)
}
got := Unlogged(w)
if want != got {