You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/go-components.md
+4-13Lines changed: 4 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Using TinyGo to compile components for Spin is currently required, as the
30
30
31
31
## Versions
32
32
33
-
TinyGo `0.30.0` is recommended, which requires Go `v1.19+`.
33
+
TinyGo `0.35.0` is recommended, which requires Go `v1.22+`. Older versions of TinyGo may not support the command-line flags used when building Spin applications.
34
34
35
35
## HTTP Components
36
36
@@ -61,16 +61,14 @@ func init() {
61
61
fmt.Fprintln(w, "Hello Fermyon!")
62
62
})
63
63
}
64
-
65
-
funcmain() {}
66
64
```
67
65
68
66
The Spin HTTP component (written in Go) can be built using the `tingygo` toolchain:
Copy file name to clipboardExpand all lines: content/v3/http-trigger.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -300,8 +300,6 @@ class IncomingHandler(http.IncomingHandler):
300
300
301
301
In Go, you register the handler as a callback in your program's `init` function. Call `spinhttp.Handle`, passing your handler as the sole argument. Your handler takes a `http.Request` record, from the standard `net/http` package, and a `ResponseWriter` to construct the response.
302
302
303
-
> The do-nothing `main` function is required by TinyGo but is not used; the action happens in the `init` function and handler callback.
0 commit comments