Skip to content

Commit

Permalink
Merge pull request #25 from erkkah/fix/getruntimecontextenv
Browse files Browse the repository at this point in the history
Fix reference to getRuntimeContextEnv
  • Loading branch information
syumai committed Mar 5, 2023
2 parents 0931e91 + 28533fa commit 48810b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cloudflare/dostub.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"syscall/js"

"github.com/syumai/workers/cloudflare/internal/cfruntimecontext"
"github.com/syumai/workers/internal/jshttp"
"github.com/syumai/workers/internal/jsutil"
)
Expand All @@ -20,7 +21,7 @@ type DurableObjectNamespace struct {
// This binding must be defined in the `wrangler.toml` file. The method will
// return an `error` when there is no binding defined by `varName`.
func NewDurableObjectNamespace(ctx context.Context, varName string) (*DurableObjectNamespace, error) {
inst := getRuntimeContextEnv(ctx).Get(varName)
inst := cfruntimecontext.GetRuntimeContextEnv(ctx).Get(varName)
if inst.IsUndefined() {
return nil, fmt.Errorf("%s is undefined", varName)
}
Expand Down

0 comments on commit 48810b5

Please sign in to comment.