mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
- replaced gofmt expression formatting algorithm with
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
This commit is contained in:
parent
baba292998
commit
3bb0032cd6
121 changed files with 750 additions and 750 deletions
|
|
@ -107,7 +107,7 @@ func Clean(path string) string {
|
|||
// If there is no slash in path, DirFile returns an empty dir and
|
||||
// file set to path.
|
||||
func Split(path string) (dir, file string) {
|
||||
for i := len(path)-1; i >= 0; i-- {
|
||||
for i := len(path) - 1; i >= 0; i-- {
|
||||
if path[i] == '/' {
|
||||
return path[0 : i+1], path[i+1 : len(path)]
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ func Join(dir, file string) string {
|
|||
if dir == "" {
|
||||
return file
|
||||
}
|
||||
return Clean(dir+"/"+file);
|
||||
return Clean(dir + "/" + file);
|
||||
}
|
||||
|
||||
// Ext returns the file name extension used by path.
|
||||
|
|
@ -129,7 +129,7 @@ func Join(dir, file string) string {
|
|||
// in the final slash-separated element of path;
|
||||
// it is empty if there is no dot.
|
||||
func Ext(path string) string {
|
||||
for i := len(path)-1; i >= 0 && path[i] != '/'; i-- {
|
||||
for i := len(path) - 1; i >= 0 && path[i] != '/'; i-- {
|
||||
if path[i] == '.' {
|
||||
return path[i:len(path)]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue