@@ -146,40 +146,12 @@ impl<'a> OutputFile<'a> {
146
146
}
147
147
Language :: Golang => {
148
148
// All packages are already published
149
-
150
- let output_dir = output_dir. join ( "internal" ) ;
151
-
152
- let ( output_dir, config) = match self . output_file {
153
- "db_response" => {
154
- let config = serde_generate:: CodeGeneratorConfig :: new (
155
- "internal_db_response" . to_string ( ) ,
156
- )
157
- . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
158
- ( output_dir. join ( "db_response" ) , config)
159
- }
160
- "db_query" => {
161
- let config = serde_generate:: CodeGeneratorConfig :: new (
162
- "internal_db_query" . to_string ( ) ,
163
- )
164
- . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
165
- ( output_dir. join ( "db_query" ) , config)
166
- }
167
- "ai_response" => {
168
- let config = serde_generate:: CodeGeneratorConfig :: new (
169
- "internal_ai_response" . to_string ( ) ,
170
- )
171
- . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
172
- ( output_dir. join ( "ai_response" ) , config)
173
- }
174
- "ai_query" => {
175
- let config = serde_generate:: CodeGeneratorConfig :: new (
176
- "internal_ai_query" . to_string ( ) ,
177
- )
178
- . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
179
- ( output_dir. join ( "ai_query" ) , config)
180
- }
181
- _ => panic ! ( "Incorrect query type" ) ,
182
- } ;
149
+ let output_dir = output_dir. join ( "internal" ) . join ( self . output_file ) ;
150
+ let config = serde_generate:: CodeGeneratorConfig :: new ( format ! (
151
+ "internal_{}" ,
152
+ self . output_file
153
+ ) )
154
+ . with_encodings ( vec ! [ serde_generate:: Encoding :: Bincode ] ) ;
183
155
// create all and ignore the errors if they exists
184
156
let _ = std:: fs:: create_dir_all ( & output_dir) ;
185
157
0 commit comments