Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bughou committed Dec 13, 2021
1 parent ea3e816 commit b9cf445
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A golang http router with regexp and document generation support.
[![Build Status](https://github.com/lovego/goa/actions/workflows/go.yml/badge.svg)](https://github.com/lovego/goa/actions/workflows/go.yml)
[![Coverage Status](https://coveralls.io/repos/github/lovego/goa/badge.svg?branch=master&1)](https://coveralls.io/github/lovego/goa)
[![Go Report Card](https://goreportcard.com/badge/github.com/lovego/goa)](https://goreportcard.com/report/github.com/lovego/goa)
[![Documentation](https://pkg.go.dev/badge/github.com/lovego/goa)](https://pkg.go.dev/github.com/lovego/goa@v0.3.1)
[![Documentation](https://pkg.go.dev/badge/github.com/lovego/goa)](https://pkg.go.dev/github.com/lovego/goa@v0.3.2)


## Usage
Expand Down
7 changes: 6 additions & 1 deletion docs/route-req.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ import (

func (r *Route) Title() string {
if f, ok := r.req.FieldByName("Title"); ok {
if comment := getComment(f.Tag); comment != "" {
return comment
}
return strings.TrimSpace(string(f.Tag))
}
return ""
}

func (r *Route) Desc(buf *bytes.Buffer) {
if f, ok := r.req.FieldByName("Desc"); ok {
if desc := strings.TrimSpace(string(f.Tag)); desc != "" {
if comment := getComment(f.Tag); comment != "" {
buf.WriteString(comment + "\n\n")
} else if desc := strings.TrimSpace(string(f.Tag)); desc != "" {
buf.WriteString(desc + "\n\n")
}
}
Expand Down

0 comments on commit b9cf445

Please sign in to comment.