Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Tiny changes to prev. commit
Browse files Browse the repository at this point in the history
Put stuff on one line and use > 0 instead of >= 1.
  • Loading branch information
miekg committed Apr 22, 2016
1 parent ca8d1bf commit 19758d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions xml2rfcv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,19 @@ func (options *xml2) TitleBlockTOML(out *bytes.Buffer, block *title) {
out.WriteString(" ipr=\"" + options.titleBlock.Ipr + "\"")
out.WriteString(" category=\"" + options.titleBlock.Category + "\"")
out.WriteString(" docName=\"" + options.titleBlock.DocName + "\"")
if len(options.titleBlock.Updates) >= 1 {
if len(options.titleBlock.Updates) > 0 {
updates := make([]string, len(options.titleBlock.Updates))
for i := range updates {
updates[i] = strconv.Itoa(options.titleBlock.Updates[i])
}
out.WriteString(" updates=\"" +
strings.Join(updates, ", ") + "\"")
out.WriteString(" updates=\"" + strings.Join(updates, ", ") + "\"")
}
if len(options.titleBlock.Obsoletes) >= 1 {
if len(options.titleBlock.Obsoletes) > 0 {
obsoletes := make([]string, len(options.titleBlock.Obsoletes))
for i := range obsoletes {
obsoletes[i] = strconv.Itoa(options.titleBlock.Obsoletes[i])
}
out.WriteString(" obsoletes=\"" +
strings.Join(obsoletes, ", ") + "\"")
out.WriteString(" obsoletes=\"" + strings.Join(obsoletes, ", ") + "\"")
}
out.WriteString(">\n")

Expand Down
10 changes: 4 additions & 6 deletions xml2rfcv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,19 @@ func (options *xml) TitleBlockTOML(out *bytes.Buffer, block *title) {
out.WriteString(" ipr=\"" + options.titleBlock.Ipr + "\"")
out.WriteString(" category=\"" + options.titleBlock.Category + "\"")
out.WriteString(" docName=\"" + options.titleBlock.DocName + "\">")
if len(options.titleBlock.Updates) >= 1 {
if len(options.titleBlock.Updates) > 0 {
updates := make([]string, len(options.titleBlock.Updates))
for i := range updates {
updates[i] = strconv.Itoa(options.titleBlock.Updates[i])
}
out.WriteString(" updates=\"" +
strings.Join(updates, ", ") + "\"")
out.WriteString(" updates=\"" + strings.Join(updates, ", ") + "\"")
}
if len(options.titleBlock.Obsoletes) >= 1 {
if len(options.titleBlock.Obsoletes) > 0 {
obsoletes := make([]string, len(options.titleBlock.Obsoletes))
for i := range obsoletes {
obsoletes[i] = strconv.Itoa(options.titleBlock.Obsoletes[i])
}
out.WriteString(" obsoletes=\"" +
strings.Join(obsoletes, ", ") + "\"")
out.WriteString(" obsoletes=\"" + strings.Join(obsoletes, ", ") + "\"")
}
out.WriteString("\n")
out.WriteString("<front>\n")
Expand Down

0 comments on commit 19758d6

Please sign in to comment.