aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2024-08-14 12:09:01 -0700
committerRon Evans <[email protected]>2024-08-15 13:57:02 +0200
commit4d60d679d3859622bd689cd4a562bcde0e8e3865 (patch)
tree67e11a174a69421410cbd9976d4ef20aa7d0f167
parent9932f2e1268d38b413ed69dc396df437810ce69b (diff)
downloadtinygo-4d60d679d3859622bd689cd4a562bcde0e8e3865.tar.gz
tinygo-4d60d679d3859622bd689cd4a562bcde0e8e3865.zip
compiler: fixup Sprintf uses
-rw-r--r--compiler/symbol.go2
-rw-r--r--main.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/symbol.go b/compiler/symbol.go
index 5ebdee147..83bb4ccb2 100644
--- a/compiler/symbol.go
+++ b/compiler/symbol.go
@@ -353,7 +353,7 @@ func (c *compilerContext) checkWasmImport(f *ssa.Function, pragma string) {
}
if f.Blocks != nil {
// Defined functions cannot be exported.
- c.addError(f.Pos(), fmt.Sprintf("can only use //go:wasmimport on declarations"))
+ c.addError(f.Pos(), "can only use //go:wasmimport on declarations")
return
}
if f.Signature.Results().Len() > 1 {
diff --git a/main.go b/main.go
index b83ea85f8..8f788efb8 100644
--- a/main.go
+++ b/main.go
@@ -958,7 +958,7 @@ func buildAndRun(pkgName string, config *compileopts.Config, stdout io.Writer, c
err = run(cmd, result)
if err != nil {
if ctx != nil && ctx.Err() == context.DeadlineExceeded {
- stdout.Write([]byte(fmt.Sprintf("--- timeout of %s exceeded, terminating...\n", timeout)))
+ fmt.Fprintf(stdout, "--- timeout of %s exceeded, terminating...\n", timeout)
err = ctx.Err()
}
return result, &commandError{"failed to run compiled binary", result.Binary, err}