diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
commit | 9464a0c36318f8a801c07d6874bd0cea40f12504 (patch) | |
tree | f0178491c19d4f1ebc7b92eede86690998466480 /src/cmd/godoc/mapping.go | |
parent | ba9fda6068cfadd42db0b152fdca7e8b67aaf77d (diff) | |
parent | 5ff4c17907d5b19510a62e08fd8d3b11e62b431d (diff) | |
download | golang-9464a0c36318f8a801c07d6874bd0cea40f12504.tar.gz |
Merge commit 'upstream/60' into debian-sid
Diffstat (limited to 'src/cmd/godoc/mapping.go')
-rw-r--r-- | src/cmd/godoc/mapping.go | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/cmd/godoc/mapping.go b/src/cmd/godoc/mapping.go index 92614e83e..51f23ab98 100644 --- a/src/cmd/godoc/mapping.go +++ b/src/cmd/godoc/mapping.go @@ -15,7 +15,6 @@ import ( "strings" ) - // A Mapping object maps relative paths (e.g. from URLs) // to absolute paths (of the file system) and vice versa. // @@ -52,13 +51,11 @@ type Mapping struct { prefixes []string // lazily computed from list } - type mapping struct { prefix, path string value *RWValue } - // Init initializes the Mapping from a list of paths. // Empty paths are ignored; relative paths are assumed to be relative to // the current working directory and converted to absolute paths. @@ -93,11 +90,9 @@ func (m *Mapping) Init(paths []string) { m.list = list } - // IsEmpty returns true if there are no mappings specified. func (m *Mapping) IsEmpty() bool { return len(m.list) == 0 } - // PrefixList returns a list of all prefixes, with duplicates removed. // For instance, for the mapping: // @@ -137,7 +132,6 @@ func (m *Mapping) PrefixList() []string { return m.prefixes } - // Fprint prints the mapping. func (m *Mapping) Fprint(w io.Writer) { for _, e := range m.list { @@ -145,7 +139,6 @@ func (m *Mapping) Fprint(w io.Writer) { } } - func splitFirst(path string) (head, tail string) { i := strings.Index(path, string(filepath.Separator)) if i > 0 { @@ -155,7 +148,6 @@ func splitFirst(path string) (head, tail string) { return "", path } - // ToAbsolute maps a slash-separated relative path to an absolute filesystem // path using the Mapping specified by the receiver. If the path cannot // be mapped, the empty string is returned. @@ -181,7 +173,6 @@ func (m *Mapping) ToAbsolute(spath string) string { return "" // no match } - // ToRelative maps an absolute filesystem path to a relative slash-separated // path using the Mapping specified by the receiver. If the path cannot // be mapped, the empty string is returned. @@ -197,7 +188,6 @@ func (m *Mapping) ToRelative(fpath string) string { return "" // no match } - // Iterate calls f for each path and RWValue in the mapping (in uspecified order) // until f returns false. // |