File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,13 @@ fn override_configuration(mut config: Config, options: &Args) -> anyhow::Result<
256
256
if let Some ( go_package) = options. go_package . as_ref ( ) {
257
257
config. go . package = go_package. to_string ( ) ;
258
258
}
259
- assert_go_package_present ( & config) ?;
259
+
260
+ if matches ! ( options. language, Some ( args:: AvailableLanguage :: Go ) ) {
261
+ anyhow:: ensure!(
262
+ !config. go. package. is_empty( ) ,
263
+ "Please provide a package name in the typeshare.toml or using --go-package <package name>"
264
+ ) ;
265
+ }
260
266
}
261
267
262
268
config. target_os = options. target_os . as_deref ( ) . unwrap_or_default ( ) . to_vec ( ) ;
@@ -287,13 +293,3 @@ fn check_parse_errors(parsed_crates: &BTreeMap<CrateName, ParsedData>) -> anyhow
287
293
Ok ( ( ) )
288
294
}
289
295
}
290
-
291
- #[ cfg( feature = "go" ) ]
292
- fn assert_go_package_present ( config : & Config ) -> anyhow:: Result < ( ) > {
293
- if config. go . package . is_empty ( ) {
294
- return Err ( anyhow ! (
295
- "Please provide a package name in the typeshare.toml or using --go-package <package name>"
296
- ) ) ;
297
- }
298
- Ok ( ( ) )
299
- }
You can’t perform that action at this time.
0 commit comments