summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/godoc/utils.go')
-rw-r--r--src/cmd/godoc/utils.go9
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
}