Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
15df7c72
Commit
15df7c72
authored
Feb 04, 2016
by
Daniel Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20592 from erictune/fix-munge-2
Print line number of failed link conversion.
parents
62e0eed2
cf4ad07a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
links.go
cmd/mungedocs/links.go
+7
-5
No files found.
cmd/mungedocs/links.go
View file @
15df7c72
...
...
@@ -122,23 +122,25 @@ func processLink(in string, filePath string) (string, error) {
// any relative links actually point to files that exist.
func
updateLinks
(
filePath
string
,
mlines
mungeLines
)
(
mungeLines
,
error
)
{
var
out
mungeLines
erro
rs
:=
[]
string
{}
allEr
rs
:=
[]
string
{}
for
_
,
mline
:=
range
mlines
{
for
lineNum
,
mline
:=
range
mlines
{
if
mline
.
preformatted
||
!
mline
.
link
{
out
=
append
(
out
,
mline
)
continue
}
line
,
err
:=
processLink
(
mline
.
data
,
filePath
)
if
err
!=
nil
{
errors
=
append
(
errors
,
err
.
Error
())
var
s
=
fmt
.
Sprintf
(
"On line %d: %s"
,
lineNum
,
err
.
Error
())
err
:=
errors
.
New
(
s
)
allErrs
=
append
(
allErrs
,
err
.
Error
())
}
ml
:=
newMungeLine
(
line
)
out
=
append
(
out
,
ml
)
}
err
:=
error
(
nil
)
if
len
(
erro
rs
)
!=
0
{
err
=
fmt
.
Errorf
(
"%s"
,
strings
.
Join
(
erro
rs
,
"
\n
"
))
if
len
(
allEr
rs
)
!=
0
{
err
=
fmt
.
Errorf
(
"%s"
,
strings
.
Join
(
allEr
rs
,
"
\n
"
))
}
return
out
,
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