Skip to content

Commit d65072e

Browse files
committed
Small changes to prepare for first release.
1 parent 12b7637 commit d65072e

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.devcontainer/devcontainer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"dockerfile": "Dockerfile",
55
"context": ".."
66
},
7+
78
"features": {
89
"devwasm.azurecr.io/dev-wasm/dev-wasm-feature/wasmtime-wasi:0.0.9": {
910
"version": "20",
@@ -12,5 +13,8 @@
1213
},
1314
"ghcr.io/devcontainers/features/common-utils": {}
1415
},
15-
"remoteEnv": { "GOROOT": "/usr/local/go" }
16+
"remoteEnv": {
17+
"PATH": "${containerEnv:PATH}:/usr/local/lib/wasi-sdk-20.0/bin:/usr/local/lib",
18+
"GOROOT": "/usr/local/go"
19+
}
1620
}

http/proxy/Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.phony: gen clean run
2+
3+
default: main.wasm
4+
5+
wasi-http: ; git clone https://github.com/WebAssembly/wasi-http; cd wasi-http; git checkout 53e2d25
6+
7+
# Note that this doesn't quite work right there's a bug in wit-bindgen 0.4.0 that missing a C definition
8+
# it is fixed in later versions, but they don't understand this wit syntax *bleeding-edge*
9+
gen: wasi-http ; wit-bindgen tiny-go ${PWD}/wasi-http/wit -w proxy
10+
11+
clean: ; rm -rf wasi-http

http/proxy/proxy_component_type.o

0 Bytes
Binary file not shown.

http/proxy/proxy_types.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package proxy
22

3-
import (
4-
"fmt"
5-
)
6-
73
// inspired from https://github.com/moznion/go-optional
84

95
type optionKind int
@@ -86,8 +82,7 @@ func (r Result[T, E]) IsErr() bool {
8682

8783
func (r Result[T, E]) Unwrap() T {
8884
if r.Kind != Ok {
89-
data := fmt.Sprintf("Result is err: %v", r.Err)
90-
panic(data)
85+
panic("Result is Err")
9186
}
9287
return r.Val
9388
}

0 commit comments

Comments
 (0)