diff --git a/.last_go_version b/.last_go_version index e25441e59..c091822bb 100644 --- a/.last_go_version +++ b/.last_go_version @@ -1 +1 @@ -6g version weekly.2011-06-16 8858+ +6g version release.r58 8944 diff --git a/clients/go/camget/camget.go b/clients/go/camget/camget.go index 1d92f9162..ec26db45e 100644 --- a/clients/go/camget/camget.go +++ b/clients/go/camget/camget.go @@ -67,12 +67,12 @@ func main() { log.Printf("Need to fetch %s", br.String()) } var ( - r io.ReadCloser + r io.ReadCloser err os.Error ) if len(*flagVia) > 0 { - vs := strings.Split(*flagVia, ",", -1) + vs := strings.Split(*flagVia, ",") abr := make([]*blobref.BlobRef, len(vs)) for i, sbr := range vs { abr[i] = blobref.Parse(sbr) diff --git a/lib/go/camli/auth/auth.go b/lib/go/camli/auth/auth.go index fef5395a8..794a4e352 100644 --- a/lib/go/camli/auth/auth.go +++ b/lib/go/camli/auth/auth.go @@ -61,7 +61,7 @@ func IsAuthorized(req *http.Request) bool { if err != nil { return false } - userpass := strings.Split(string(decBuf[0:n]), ":", 2) + userpass := strings.SplitN(string(decBuf[0:n]), ":", 2) if len(userpass) != 2 { fmt.Println("didn't get two pieces") return false @@ -72,8 +72,8 @@ func IsAuthorized(req *http.Request) bool { // requireAuth wraps a function with another function that enforces // HTTP Basic Auth. -func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func (conn http.ResponseWriter, req *http.Request) { - return func (conn http.ResponseWriter, req *http.Request) { +func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func(conn http.ResponseWriter, req *http.Request) { + return func(conn http.ResponseWriter, req *http.Request) { if IsAuthorized(req) { handler(conn, req) } else { @@ -81,4 +81,3 @@ func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func } } } - diff --git a/lib/go/camli/blobserver/handlers/get.go b/lib/go/camli/blobserver/handlers/get.go index 3634a9c9d..daa19ca16 100644 --- a/lib/go/camli/blobserver/handlers/get.go +++ b/lib/go/camli/blobserver/handlers/get.go @@ -197,7 +197,7 @@ blobRef *blobref.BlobRef, fetcher blobref.StreamingFetcher) { }() viaBlobs := make([]*blobref.BlobRef, 0) if via := req.FormValue("via"); via != "" { - for _, vs := range strings.Split(via, ",", -1) { + for _, vs := range strings.Split(via, ",") { if br := blobref.Parse(vs); br == nil { httputil.BadRequestError(conn, "Malformed blobref in via param") return diff --git a/lib/go/camli/client/sync_test.go b/lib/go/camli/client/sync_test.go index 1a3661f4f..1ab6da965 100644 --- a/lib/go/camli/client/sync_test.go +++ b/lib/go/camli/client/sync_test.go @@ -50,7 +50,7 @@ func sendTestBlobs(ch chan blobref.SizedBlobRef, list string) { if list == "" { return } - for _, b := range strings.Split(list, ",", -1) { + for _, b := range strings.Split(list, ",") { br := blobref.Parse(b) if br == nil { panic("Invalid blobref: " + b) diff --git a/lib/go/camli/misc/gpgagent/gpgagent.go b/lib/go/camli/misc/gpgagent/gpgagent.go index de9627b88..e05be3cf8 100644 --- a/lib/go/camli/misc/gpgagent/gpgagent.go +++ b/lib/go/camli/misc/gpgagent/gpgagent.go @@ -38,7 +38,7 @@ var ErrNoData = os.NewError("GPG_ERR_NO_DATA cache miss") var ErrCancel = os.NewError("gpgagent: Cancel") func NewConn() (*Conn, os.Error) { - sp := strings.Split(os.Getenv("GPG_AGENT_INFO"), ":", 3) + sp := strings.SplitN(os.Getenv("GPG_AGENT_INFO"), ":", 3) if len(sp) == 0 || len(sp[0]) == 0 { return nil, ErrNoAgent } @@ -153,7 +153,7 @@ func (c *Conn) GetPassphrase(pr *PassphraseRequest) (passphrase string, outerr o } return string(decb), nil } - fields := strings.Split(line, " ", -1) + fields := strings.Split(line, " ") if len(fields) >= 2 && fields[0] == "ERR" { switch fields[1] { case "67108922": diff --git a/lib/go/camli/misc/vfs/servefile.go b/lib/go/camli/misc/vfs/servefile.go index 8d448b2dc..ccfcdf329 100644 --- a/lib/go/camli/misc/vfs/servefile.go +++ b/lib/go/camli/misc/vfs/servefile.go @@ -235,7 +235,7 @@ func parseRange(s string, size int64) ([]httpRange, os.Error) { return nil, os.NewError("invalid range") } var ranges []httpRange - for _, ra := range strings.Split(s[len(b):], ",", -1) { + for _, ra := range strings.Split(s[len(b):], ",") { i := strings.Index(ra, "-") if i < 0 { return nil, os.NewError("invalid range") @@ -290,4 +290,3 @@ func ServeFile(w http.ResponseWriter, r *http.Request, name string) { func ServeFileFromFS(w http.ResponseWriter, r *http.Request, fs FileSystem, name string) { serveFile(w, r, name, fs, false) } - diff --git a/lib/go/camli/schema/schema.go b/lib/go/camli/schema/schema.go index 373fc76ac..7506457c0 100644 --- a/lib/go/camli/schema/schema.go +++ b/lib/go/camli/schema/schema.go @@ -91,10 +91,10 @@ type Superset struct { } type ContentPart struct { - BlobRef *blobref.BlobRef "blobRef" - SubBlobRef *blobref.BlobRef "subFileBlobRef" - Size uint64 "size" - Offset uint64 "offset" + BlobRef *blobref.BlobRef "blobRef" + SubBlobRef *blobref.BlobRef "subFileBlobRef" + Size uint64 "size" + Offset uint64 "offset" } func stringFromMixedArray(parts []interface{}) string { @@ -418,7 +418,7 @@ func populateMap(m map[int]string, file string) { if err != nil { return } - parts := strings.Split(line, ":", 4) + parts := strings.SplitN(line, ":", 4) if len(parts) >= 3 { idstr := parts[2] id, err := strconv.Atoi(idstr) diff --git a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/fuse.go b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/fuse.go index c8ae8ce10..828dfda82 100644 --- a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/fuse.go +++ b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/fuse.go @@ -412,14 +412,14 @@ func (me *MountState) dispatch(req *fuseRequest) { case FUSE_RMDIR: status = fs.Rmdir(h, filename) case FUSE_SYMLINK: - filenames := strings.Split(string(req.arg.Bytes()), "\x00", 3) + filenames := strings.SplitN(string(req.arg.Bytes()), "\x00", 3) if len(filenames) >= 2 { out, status = fs.Symlink(h, filenames[1], filenames[0]) } else { status = EIO } case FUSE_RENAME: - filenames := strings.Split(string(req.arg.Bytes()), "\x00", 3) + filenames := strings.SplitN(string(req.arg.Bytes()), "\x00", 3) if len(filenames) >= 2 { status = fs.Rename(h, input.(*RenameIn), filenames[0], filenames[1]) } else { diff --git a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/pathfilesystem.go b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/pathfilesystem.go index f7e6e8c7c..a90c78736 100644 --- a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/pathfilesystem.go +++ b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/pathfilesystem.go @@ -278,7 +278,7 @@ func (me *PathFileSystemConnector) unlinkUpdate(nodeid uint64, name string) { // Walk the file system starting from the root. func (me *PathFileSystemConnector) findInode(fullPath string) *inodeData { fullPath = strings.TrimLeft(filepath.Clean(fullPath), "/") - comps := strings.Split(fullPath, "/", -1) + comps := strings.Split(fullPath, "/") me.lock.RLock() defer me.lock.RUnlock() diff --git a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/xattr.go b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/xattr.go index d9fac9a76..e4d9b150f 100644 --- a/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/xattr.go +++ b/lib/go/camli/third_party/github.com/hanwen/go-fuse/fuse/xattr.go @@ -65,6 +65,6 @@ func ListXAttr(path string) (attributes [][]byte, errno int) { // -1 to drop the final empty slice. dest = dest[:sz-1] - attributes = bytes.Split(dest, []byte{0}, -1) + attributes = bytes.Split(dest, []byte{0}) return attributes, errno } diff --git a/website/camweb.go b/website/camweb.go index aed22d8fe..baae8f539 100644 --- a/website/camweb.go +++ b/website/camweb.go @@ -262,10 +262,10 @@ func main() { } mux := http.DefaultServeMux - mux.Handle("/favicon.ico", http.FileServer(filepath.Join(*root, "static"), "/")) - mux.Handle("/robots.txt", http.FileServer(filepath.Join(*root, "static"), "/")) - mux.Handle("/static/", http.FileServer(filepath.Join(*root, "static"), "/static/")) - mux.Handle("/talks/", http.FileServer(filepath.Join(*root, "talks"), "/talks/")) + mux.Handle("/favicon.ico", http.FileServer(http.Dir(filepath.Join(*root, "static")))) + mux.Handle("/robots.txt", http.FileServer(http.Dir(filepath.Join(*root, "static")))) + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(filepath.Join(*root, "static"))))) + mux.Handle("/talks/", http.StripPrefix("/talks/", http.FileServer(http.Dir(filepath.Join(*root, "talks"))))) gerritUrl, _ := http.ParseURL("http://gerrit-proxy:8000/") var gerritHandler http.Handler = http.NewSingleHostReverseProxy(gerritUrl) @@ -299,7 +299,7 @@ func main() { Root: "/code/", Env: env, }, - Static: http.FileServer(*gitwebFiles, "/code/"), + Static: http.StripPrefix("/code/", http.FileServer(http.Dir(*gitwebFiles))), }}) } mux.HandleFunc("/", mainHandler)