Skip to content

Commit

Permalink
chore(gen): update getdoc to v0.1.0
Browse files Browse the repository at this point in the history
Now newlines are handled correctly.
  • Loading branch information
ernado committed Dec 5, 2020
1 parent cf97d66 commit f617e5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/go-openapi/inflect v0.19.0
github.com/go-playground/validator/v10 v10.4.1
github.com/gotd/getdoc v0.0.0-20201205191539-f6d6865ab423
github.com/gotd/getdoc v0.1.0
github.com/gotd/tl v0.2.0
github.com/stretchr/testify v1.6.1
go.uber.org/zap v1.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gotd/getdoc v0.0.0-20201205191539-f6d6865ab423 h1:u8t4T2E/xBtEhRviTvZUwF4b5lCghwMOPvjksrUTvME=
github.com/gotd/getdoc v0.0.0-20201205191539-f6d6865ab423/go.mod h1:0tPkUBtE8K7RkL0JQrXn2dh/Bx++7YPqTOUFSrSok/M=
github.com/gotd/getdoc v0.1.0 h1:yvzgSmQzR9/v1pAplsrGoMUrBRZC3PW2KoG0f9tiK0g=
github.com/gotd/getdoc v0.1.0/go.mod h1:0tPkUBtE8K7RkL0JQrXn2dh/Bx++7YPqTOUFSrSok/M=
github.com/gotd/tl v0.2.0 h1:kY0lKrNBL/ApU2enzsR2or0U/hoh4y1Msf1SJjS7/qY=
github.com/gotd/tl v0.2.0/go.mod h1:9xGV9pH5N+LDoNmbeuOor9AjJaQzlj4KP5EguI1LMM8=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
Expand Down
10 changes: 0 additions & 10 deletions internal/gen/make_structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ func (g *Generator) docMethod(k string) getdoc.Method {
return g.doc.Methods[k]
}

func trimDocs(docs []string) []string {
var out []string
for _, s := range docs {
s = strings.TrimSpace(s)
out = append(out, strings.Split(s, "\n")...)
}
return out
}

// makeStructures generates go structure definition representations.
//
// nolint:gocognit,gocyclo // TODO(ernado): simplify
Expand Down Expand Up @@ -125,7 +116,6 @@ func (g *Generator) makeStructures() error {
if t.Method != "" {
s.Docs = docMethod.Description
}
s.Docs = trimDocs(s.Docs)
if g.docBase != nil {
// Assuming constructor by default.
s.URL = g.docURL("constructor", typeKey)
Expand Down

0 comments on commit f617e5e

Please sign in to comment.