~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/godoc/utils.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
}
45
45
 
46
46
 
 
47
// TODO(gri) For now, using os.Getwd() is ok here since the functionality
 
48
//           based on this code is not invoked for the appengine version,
 
49
//           but this is fragile. Determine what the right thing to do is,
 
50
//           here (possibly have some Getwd-equivalent in FileSystem).
47
51
var cwd, _ = os.Getwd() // ignore errors
48
52
 
49
53
// canonicalizePaths takes a list of (directory/file) paths and returns
76
80
        list = list[0:i]
77
81
 
78
82
        // sort the list and remove duplicate entries
79
 
        sort.SortStrings(list)
 
83
        sort.Strings(list)
80
84
        i = 0
81
85
        prev := ""
82
86
        for _, path := range list {
95
99
// atomically renames that file to the file named by filename.
96
100
//
97
101
func writeFileAtomically(filename string, data []byte) os.Error {
 
102
        // TODO(gri) this won't work on appengine
98
103
        f, err := ioutil.TempFile(filepath.Split(filename))
99
104
        if err != nil {
100
105
                return err
155
160
 
156
161
        // the extension is not known; read an initial chunk
157
162
        // of the file and check if it looks like text
158
 
        f, err := os.Open(filename)
 
163
        f, err := fs.Open(filename)
159
164
        if err != nil {
160
165
                return false
161
166
        }