File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -95,19 +95,21 @@ function buildOpts(body, cliOpts) {
95
95
return opts
96
96
}
97
97
98
- function buildContent ( struct , path , comment ) {
98
+ function buildContent ( go , path , comment ) {
99
99
let content = `// Code generated by api-to-go (https://github.com/nkmr-jp/api-to-go).\n\n`
100
100
content += `package ${ path . pkg } \n\n`
101
- if ( struct . indexOf ( 'time.' ) !== - 1 ) {
101
+ if ( go . indexOf ( 'time.' ) !== - 1 ) {
102
102
content += `${ content } import "time"\n\n`
103
103
}
104
+
105
+ content += `// ${ go . split ( " " ) [ 1 ] } is the go struct of api's payload.\n//`
104
106
content += comment
105
- content += struct
107
+ content += go
106
108
return content
107
109
}
108
110
109
111
function buildComment ( url , path , method , res ) {
110
- let comment = `// ${ path . struct } is the go struct of api's payload.\n//`
112
+ let comment = ""
111
113
const cfg = loadConfig ( url , configFile )
112
114
if ( cfg ?. [ "docs" ] !== undefined ) {
113
115
comment += `\n// Docs: ${ cfg ?. [ "docs" ] } `
You can’t perform that action at this time.
0 commit comments