diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 | 
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 | 
| commit | 28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch) | |
| tree | 32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/cmd/godoc/utils.go | |
| parent | e836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff) | |
| download | golang-28592ee1ea1f5cdffcf85472f9de0285d928cf12.tar.gz | |
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/cmd/godoc/utils.go')
| -rw-r--r-- | src/cmd/godoc/utils.go | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/src/cmd/godoc/utils.go b/src/cmd/godoc/utils.go index 593b51ce0..e2637ab3d 100644 --- a/src/cmd/godoc/utils.go +++ b/src/cmd/godoc/utils.go @@ -44,6 +44,10 @@ func (v *RWValue) get() (interface{}, int64) {  } +// TODO(gri) For now, using os.Getwd() is ok here since the functionality +//           based on this code is not invoked for the appengine version, +//           but this is fragile. Determine what the right thing to do is, +//           here (possibly have some Getwd-equivalent in FileSystem).  var cwd, _ = os.Getwd() // ignore errors  // canonicalizePaths takes a list of (directory/file) paths and returns @@ -76,7 +80,7 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string {  	list = list[0:i]  	// sort the list and remove duplicate entries -	sort.SortStrings(list) +	sort.Strings(list)  	i = 0  	prev := ""  	for _, path := range list { @@ -95,6 +99,7 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string {  // atomically renames that file to the file named by filename.  //  func writeFileAtomically(filename string, data []byte) os.Error { +	// TODO(gri) this won't work on appengine  	f, err := ioutil.TempFile(filepath.Split(filename))  	if err != nil {  		return err @@ -155,7 +160,7 @@ func isTextFile(filename string) bool {  	// the extension is not known; read an initial chunk  	// of the file and check if it looks like text -	f, err := os.Open(filename) +	f, err := fs.Open(filename)  	if err != nil {  		return false  	} | 
