Permalink
Browse files

Updating to compile on weekly.2012-03-04

  • Loading branch information...
1 parent 34cf5e5 commit 6d064afb0755b02a13092b8453452015b8cfbf86 @paulbellamy committed Mar 10, 2012
Showing with 28 additions and 23 deletions.
  1. +2 −2 examples/cats.go
  2. +1 −1 jsonp_test.go
  3. +1 −1 logger_test.go
  4. +2 −2 mango.go
  5. +2 −2 mango_test.go
  6. +1 −1 mime_test.go
  7. +1 −1 redirect_test.go
  8. +1 −1 routing_test.go
  9. +5 −4 sessions.go
  10. +1 −1 sessions_test.go
  11. +1 −1 show_errors.go
  12. +1 −1 show_errors_test.go
  13. +8 −4 static.go
  14. +1 −1 static_test.go
View
@@ -3,7 +3,7 @@ package main
import (
"mango"
"cats_middleware"
- "http"
+ "net/http"
"os"
"io/ioutil"
)
@@ -39,4 +39,4 @@ func main() {
stack.Middleware(cats_middleware) // Include the Cats middleware in our stack
stack.Run(Hello)
-}
+}
View
@@ -1,7 +1,7 @@
package mango
import (
- "http"
+ "net/http"
"testing"
"runtime"
)
View
@@ -2,7 +2,7 @@ package mango
import (
"bytes"
- "http"
+ "net/http"
"log"
"testing"
"runtime"
View
@@ -3,7 +3,7 @@ package mango
import (
"fmt"
- "http"
+ "net/http"
"log"
"net/textproto"
"os"
@@ -138,7 +138,7 @@ func (this *Stack) HandlerFunc(app App) http.HandlerFunc {
}
}
-func (this *Stack) Run(app App) os.Error {
+func (this *Stack) Run(app App) error {
if this.Address == "" {
this.Address = "0.0.0.0:8000"
}
View
@@ -1,11 +1,11 @@
package mango
import (
- "http/httptest"
+ "net/http/httptest"
"io/ioutil"
"testing"
"fmt"
- "http"
+ "net/http"
"runtime"
)
View
@@ -53,7 +53,7 @@ func TestRemovingMimeTypes(t *testing.T) {
t.Error("Expected", value, "to have mime type:", expected, "got:", found)
}
- MimeTypes[".jpg"] = "", false
+ delete(MimeTypes, ".jpg")
found = MimeType(value, fallback)
if found != fallback {
View
@@ -1,7 +1,7 @@
package mango
import (
- "http"
+ "net/http"
"testing"
"runtime"
)
View
@@ -1,7 +1,7 @@
package mango
import (
- "http"
+ "net/http"
"testing"
"runtime"
)
View
@@ -4,18 +4,19 @@ import (
"bytes"
"hash"
"crypto/hmac"
+ "crypto/sha1"
"encoding/base64"
"fmt"
"io/ioutil"
- "gob"
- "http"
+ "encoding/gob"
+ "net/http"
"strings"
)
func hashCookie(data, secret string) (sum string) {
- var h hash.Hash = hmac.NewSHA1([]byte(secret))
+ var h hash.Hash = hmac.New(sha1.New, []byte(secret))
h.Write([]byte(data))
- return string(h.Sum())
+ return string(h.Sum(nil))
}
func verifyCookie(data, secret, sum string) bool {
View
@@ -1,7 +1,7 @@
package mango
import (
- "http"
+ "net/http"
"runtime"
"strings"
"testing"
View
@@ -3,7 +3,7 @@ package mango
import (
"bytes"
"fmt"
- "template"
+ "html/template"
)
func ShowErrors(templateString string) Middleware {
View
@@ -1,7 +1,7 @@
package mango
import (
- "http"
+ "net/http"
"testing"
"runtime"
)
View
@@ -6,18 +6,22 @@ import (
"os"
)
+func fileIsRegular(fi os.FileInfo) bool {
+ return fi.Mode() & (os.ModeDir | os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice) == 0
+}
+
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if err != nil {
return false
- } else if !info.IsRegular() {
- return false
- }
+ } else if !fileIsRegular(info) {
+ return false
+ }
return true
}
-func readFile(filename string) (string, os.Error) {
+func readFile(filename string) (string, error) {
body, err := ioutil.ReadFile(filename)
return string(body), err
}
View
@@ -2,7 +2,7 @@ package mango
import (
"bytes"
- "http"
+ "net/http"
"io/ioutil"
"testing"
"runtime"

0 comments on commit 6d064af

Please sign in to comment.