mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
all: change //go:export to //export
This is the kind that is used in Go (actually CGo) for exporting functions. I think it's best to use //export instead of our custom //go:export pragma, for consistency (they are equivalent in TinyGo). Therefore I've updated all instances to the standard format (except for two that are updated in https://github.com/tinygo-org/tinygo/pull/1024). No smoke tests changed (when comparing the output hash), except for some wasm tests that include DWARF debug info and tend to be flaky anyway.
This commit is contained in:
@@ -17,7 +17,7 @@ func main() {
|
||||
|
||||
var led_state bool
|
||||
|
||||
//go:export SysTick_Handler
|
||||
//export SysTick_Handler
|
||||
func timer_isr() {
|
||||
if led_state {
|
||||
machine.LED.Low()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The examples here show two different ways of using WebAssembly with TinyGo:
|
||||
|
||||
1. Defining and exporting functions via the `//go:export <name>` directive. See
|
||||
1. Defining and exporting functions via the `//export <name>` directive. See
|
||||
[the export folder](./export) for an example of this. Additionally, the Wasm
|
||||
module (which has a default value of `env`) can be specified using
|
||||
`//go:wasm-module <module>`.
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
func main() {
|
||||
}
|
||||
|
||||
//go:export add
|
||||
//export add
|
||||
func add(a, b int) int {
|
||||
return a + b
|
||||
}
|
||||
|
||||
//go:export update
|
||||
//export update
|
||||
func update() {
|
||||
document := js.Global().Get("document")
|
||||
aStr := document.Call("getElementById", "a").Get("value").String()
|
||||
|
||||
Reference in New Issue
Block a user