MCPcopy
hub / github.com/tinygo-org/tinygo / validateOutputFormat

Function validateOutputFormat

main.go:351–357  ·  view source on GitHub ↗

validateOutputFormat checks if the output file extension matches the expected format

(outpath, expectedExt string)

Source from the content-addressed store, hash-verified

349
350// validateOutputFormat checks if the output file extension matches the expected format
351func 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.
360func Flash(pkgName, port, outpath string, options *compileopts.Options) error {

Callers 1

FlashFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected