Skip to content

Commit 4fb282d

Browse files
committed
📝 Update generated comments
1 parent 866e567 commit 4fb282d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bin/api-to-go.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ function _buildContent(struct, path, apiUrl) {
3030
if (struct.indexOf('time.') !== -1) {
3131
content = `${content}import "time"\n\n`
3232
}
33-
let comment = `// ${path.struct} is struct of API's payload.\n`
34-
comment += `// url: ${apiUrl}\n`
35-
if (path.path.pathFormat) comment += `// format: ${path.path.pathFormat}\n`
36-
comment += `// example: ${path.jsonFilePath}\n`
37-
content = `${content}${comment}${struct}`
33+
let comment = `// ${path.struct} ${apiUrl}`
34+
if (path.path.pathFormat) comment += ` (${path.path.pathFormat})`
35+
content = `${content}${comment}\n${struct}`
3836
return content
3937
}
4038

0 commit comments

Comments
 (0)