Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
05851636
Commit
05851636
authored
May 14, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
godoc fix: relative paths were incorrect
R=r DELTA=13 (1 added, 6 deleted, 6 changed) OCL=28840 CL=28844
parent
ea79b82e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
usr/gri/pretty/dirlist.html
usr/gri/pretty/dirlist.html
+2
-2
usr/gri/pretty/godoc.go
usr/gri/pretty/godoc.go
+5
-10
No files found.
usr/gri/pretty/dirlist.html
View file @
05851636
{.repeated section
Dirs
}
<a
href=
"{
Path|html}/{Name|html}
"
>
{Name|html}
</a><br
/>
{.repeated section
@
}
<a
href=
"{
Name|html}/
"
>
{Name|html}
</a><br
/>
{.end}
usr/gri/pretty/godoc.go
View file @
05851636
...
...
@@ -448,12 +448,13 @@ func isPackageFile(dirname, filename, pakname string) bool {
}
// Returns the package denoted by
import
path and the list of
// Returns the package denoted by path and the list of
// sub-directories in the corresponding package directory.
// If there is no such package, the first result is nil. If
// there are no sub-directories, that list is nil.
func
findPackage
(
import
path
string
)
(
*
pakDesc
,
dirList
)
{
func
findPackage
(
path
string
)
(
*
pakDesc
,
dirList
)
{
// get directory contents, if possible
importpath
:=
pathutil
.
Clean
(
path
);
// no trailing '/'
dirname
:=
pathutil
.
Join
(
*
pkgroot
,
importpath
);
if
!
isDir
(
dirname
)
{
return
nil
,
nil
;
...
...
@@ -472,7 +473,7 @@ func findPackage(importpath string) (*pakDesc, dirList) {
}
// the package name is is the directory name within its parent
_
,
pakname
:=
pathutil
.
Split
(
importpath
);
_
,
pakname
:=
pathutil
.
Split
(
dirname
);
// collect all files belonging to the package and count the
// number of sub-directories
...
...
@@ -562,15 +563,9 @@ func servePackage(c *http.Conn, desc *pakDesc) {
}
type
Dirs
struct
{
Path
string
;
Dirs
dirList
;
}
func
serveDirList
(
c
*
http
.
Conn
,
path
string
,
dirs
dirList
)
{
var
buf
io
.
ByteBuffer
;
err
:=
dirlistHtml
.
Execute
(
Dirs
{
path
,
dirs
}
,
&
buf
);
err
:=
dirlistHtml
.
Execute
(
dirs
,
&
buf
);
if
err
!=
nil
{
log
.
Stderrf
(
"dirlist.Execute: %s"
,
err
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment