1- import { GO_DESCRIPTION_PRESET , GO_COMMON_PRESET , GoCommonPresetOptions , GoFileGenerator } from "@asyncapi/modelina" ;
1+ import { GoFileGenerator } from "@asyncapi/modelina" ;
22import { BuilderReturnType } from "./generate" ;
3- import { Flags } from "@oclif/core" ;
43
5- export const GoOclifFlags = {
6- goIncludeComments : Flags . boolean ( {
7- description : 'Golang specific, if enabled add comments while generating models.' ,
8- required : false ,
9- default : false ,
10- } ) ,
11- goIncludeTags : Flags . boolean ( {
12- description : 'Golang specific, if enabled add tags while generating models.' ,
13- required : false ,
14- default : false ,
15- } ) ,
16- }
4+ export const GoOclifFlags = { }
175
186/**
197 * This function builds all the relevant information for the main generate command
@@ -22,20 +10,13 @@ export const GoOclifFlags = {
2210 * @returns
2311 */
2412export function buildGoGenerator ( flags : any ) : BuilderReturnType {
25- const { packageName, goIncludeComments , goIncludeTags } = flags ;
26-
13+ const { packageName } = flags ;
14+
2715 if ( packageName === undefined ) {
2816 throw new Error ( 'In order to generate models to Go, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.' ) ;
2917 }
3018
31- const presets = [ ]
32- if ( goIncludeTags ) {
33- const options : GoCommonPresetOptions = { addJsonTag : true } ;
34- presets . push ( { preset : GO_COMMON_PRESET , options } )
35- }
36-
37- if ( goIncludeComments ) { presets . push ( GO_DESCRIPTION_PRESET ) ; }
38- const fileGenerator = new GoFileGenerator ( { presets } ) ;
19+ const fileGenerator = new GoFileGenerator ( ) ;
3920 const fileOptions = {
4021 packageName
4122 } ;
0 commit comments