validateOutputFormat checks if the output file extension matches the expected format
(outpath, expectedExt string)
| 349 | |
| 350 | // validateOutputFormat checks if the output file extension matches the expected format |
| 351 | func validateOutputFormat(outpath, expectedExt string) error { |
| 352 | actualExt := filepath.Ext(outpath) |
| 353 | if actualExt != expectedExt { |
| 354 | return fmt.Errorf("output format %s does not match target format %s", actualExt, expectedExt) |
| 355 | } |
| 356 | return nil |
| 357 | } |
| 358 | |
| 359 | // Flash builds and flashes the built binary to the given serial port. |
| 360 | func Flash(pkgName, port, outpath string, options *compileopts.Options) error { |