mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 4th set of files. R=rsc CC=golang-dev https://golang.org/cl/180049
This commit is contained in:
parent
a3d1045fb7
commit
d65a5cce89
119 changed files with 14325 additions and 14325 deletions
|
|
@ -10,10 +10,10 @@ package rpc
|
|||
*/
|
||||
|
||||
import (
|
||||
"fmt";
|
||||
"http";
|
||||
"sort";
|
||||
"template";
|
||||
"fmt"
|
||||
"http"
|
||||
"sort"
|
||||
"template"
|
||||
)
|
||||
|
||||
const debugText = `<html>
|
||||
|
|
@ -39,47 +39,47 @@ const debugText = `<html>
|
|||
var debug = template.MustParse(debugText, nil)
|
||||
|
||||
type debugMethod struct {
|
||||
m *methodType;
|
||||
name string;
|
||||
m *methodType
|
||||
name string
|
||||
}
|
||||
|
||||
type methodArray []debugMethod
|
||||
|
||||
type debugService struct {
|
||||
s *service;
|
||||
name string;
|
||||
meth methodArray;
|
||||
s *service
|
||||
name string
|
||||
meth methodArray
|
||||
}
|
||||
|
||||
type serviceArray []debugService
|
||||
|
||||
func (s serviceArray) Len() int { return len(s) }
|
||||
func (s serviceArray) Less(i, j int) bool { return s[i].name < s[j].name }
|
||||
func (s serviceArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s serviceArray) Len() int { return len(s) }
|
||||
func (s serviceArray) Less(i, j int) bool { return s[i].name < s[j].name }
|
||||
func (s serviceArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
|
||||
func (m methodArray) Len() int { return len(m) }
|
||||
func (m methodArray) Less(i, j int) bool { return m[i].name < m[j].name }
|
||||
func (m methodArray) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
|
||||
func (m methodArray) Len() int { return len(m) }
|
||||
func (m methodArray) Less(i, j int) bool { return m[i].name < m[j].name }
|
||||
func (m methodArray) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
|
||||
|
||||
// Runs at /debug/rpc
|
||||
func debugHTTP(c *http.Conn, req *http.Request) {
|
||||
// Build a sorted version of the data.
|
||||
var services = make(serviceArray, len(server.serviceMap));
|
||||
i := 0;
|
||||
server.Lock();
|
||||
var services = make(serviceArray, len(server.serviceMap))
|
||||
i := 0
|
||||
server.Lock()
|
||||
for sname, service := range server.serviceMap {
|
||||
services[i] = debugService{service, sname, make(methodArray, len(service.method))};
|
||||
j := 0;
|
||||
services[i] = debugService{service, sname, make(methodArray, len(service.method))}
|
||||
j := 0
|
||||
for mname, method := range service.method {
|
||||
services[i].meth[j] = debugMethod{method, mname};
|
||||
j++;
|
||||
services[i].meth[j] = debugMethod{method, mname}
|
||||
j++
|
||||
}
|
||||
sort.Sort(services[i].meth);
|
||||
i++;
|
||||
sort.Sort(services[i].meth)
|
||||
i++
|
||||
}
|
||||
server.Unlock();
|
||||
sort.Sort(services);
|
||||
err := debug.Execute(services, c);
|
||||
server.Unlock()
|
||||
sort.Sort(services)
|
||||
err := debug.Execute(services, c)
|
||||
if err != nil {
|
||||
fmt.Fprintln(c, "rpc: error executing template:", err.String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue