Skip to content

Commit

Permalink
Small changes to prepare for first release.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Jul 31, 2023
1 parent 12b7637 commit d65072e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dockerfile": "Dockerfile",
"context": ".."
},

"features": {
"devwasm.azurecr.io/dev-wasm/dev-wasm-feature/wasmtime-wasi:0.0.9": {
"version": "20",
Expand All @@ -12,5 +13,8 @@
},
"ghcr.io/devcontainers/features/common-utils": {}
},
"remoteEnv": { "GOROOT": "/usr/local/go" }
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/usr/local/lib/wasi-sdk-20.0/bin:/usr/local/lib",
"GOROOT": "/usr/local/go"
}
}
11 changes: 11 additions & 0 deletions http/proxy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.phony: gen clean run

default: main.wasm

wasi-http: ; git clone https://github.com/WebAssembly/wasi-http; cd wasi-http; git checkout 53e2d25

# Note that this doesn't quite work right there's a bug in wit-bindgen 0.4.0 that missing a C definition
# it is fixed in later versions, but they don't understand this wit syntax *bleeding-edge*
gen: wasi-http ; wit-bindgen tiny-go ${PWD}/wasi-http/wit -w proxy

clean: ; rm -rf wasi-http
Binary file modified http/proxy/proxy_component_type.o
Binary file not shown.
7 changes: 1 addition & 6 deletions http/proxy/proxy_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package proxy

import (
"fmt"
)

// inspired from https://github.com/moznion/go-optional

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

func (r Result[T, E]) Unwrap() T {
if r.Kind != Ok {
data := fmt.Sprintf("Result is err: %v", r.Err)
panic(data)
panic("Result is Err")
}
return r.Val
}
Expand Down

0 comments on commit d65072e

Please sign in to comment.