File tree Expand file tree Collapse file tree 6 files changed +11
-12
lines changed Expand file tree Collapse file tree 6 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -440,8 +440,9 @@ mod tests {
440
440
let mut cmd = process:: Command :: new ( "tinygo" ) ;
441
441
cmd. arg ( "build" )
442
442
. current_dir ( "tests/go-case" )
443
- . arg ( "-target=wasi " )
443
+ . arg ( "-target=wasip1 " )
444
444
. arg ( "-gc=leaking" )
445
+ . arg ( "-buildmode=c-shared" )
445
446
. arg ( "-no-debug" )
446
447
. arg ( "-o" )
447
448
. arg ( out_dir. join ( "go_case.wasm" ) )
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "fmt"
5
- "net/http"
6
4
"errors"
7
- "strings "
5
+ "fmt "
8
6
"io"
7
+ "net/http"
9
8
"os"
9
+ "strings"
10
10
11
- spinredis "github.com/fermyon/spin/sdk/go/redis"
12
- spinhttp "github.com/fermyon/spin/sdk/go/http"
13
11
spinconfig "github.com/fermyon/spin/sdk/go/config"
12
+ spinhttp "github.com/fermyon/spin/sdk/go/http"
13
+ spinredis "github.com/fermyon/spin/sdk/go/redis"
14
14
)
15
15
16
16
func init () {
@@ -65,5 +65,3 @@ func execute(v []string) error {
65
65
66
66
return nil
67
67
}
68
-
69
- func main () {}
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ allowed_http_hosts = []
12
12
[component .trigger ]
13
13
route = " /..."
14
14
[component .build ]
15
- command = " tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go "
15
+ command = " tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared - no-debug -o main.wasm . "
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ component = "{{project-name | kebab_case}}"
14
14
source = " main.wasm"
15
15
allowed_outbound_hosts = []
16
16
[component .{{project-name | kebab_case}} .build ]
17
- command = " tinygo build -target=wasip1 -gc=leaking -scheduler=none - buildmode=c-shared -no-debug -o main.wasm ."
17
+ command = " tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."
18
18
watch = [" **/*.go" , " go.mod" ]
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ component = "{{project-name | kebab_case}}"
6
6
source = "{{ output-path }}/main.wasm"
7
7
allowed_outbound_hosts = []
8
8
[component.{{project-name | kebab_case}}.build]
9
- command = "tinygo build -target=wasip1 -gc=leaking -scheduler=none - buildmode=c-shared -no-debug -o main.wasm ."
9
+ command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."
10
10
workdir = "{{ output-path }}"
11
11
watch = ["**/*.go", "go.mod"]
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ component = "{{project-name | kebab_case}}"
17
17
source = " main.wasm"
18
18
allowed_outbound_hosts = []
19
19
[component .{{project-name | kebab_case}} .build ]
20
- command = " tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go "
20
+ command = " tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared - no-debug -o main.wasm . "
You can’t perform that action at this time.
0 commit comments