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