Giter Club home page Giter Club logo

Comments (4)

losfair avatar losfair commented on July 20, 2024

A runtime is needed to run WebAssembly modules compiled from Go. What runtime are you using? Are you sure that the panic originates from the default branch but not somewhere else? And what message did you get exactly when the program panics?

from life.

icexin avatar icexin commented on July 20, 2024

I Wrote a simple version wasm go runtime.

https://gist.github.com/icexin/3123b51d2ae97c21aade3ea2975ecea2

The output is

Resolve func: go debug
Resolve func: go runtime.wasmExit
Resolve func: go runtime.wasmWrite
Resolve func: go runtime.nanotime
Resolve func: go runtime.walltime
Resolve func: go runtime.scheduleCallback
Resolve func: go runtime.clearScheduledCallback
Resolve func: go runtime.getRandomData
panic: f64

goroutine 1 [running]:
main.main()
	/Users/icexin/test/wasm/switch.go:11 +0x16
return value = 0, duration = 20.195955ms

from life.

icexin avatar icexin commented on July 20, 2024

@losfair Any progress?

from life.

maxmcd avatar maxmcd commented on July 20, 2024

I've run into this same issue. Can reproduce. Although for me it seems to be related to how many switch cases are available. This runs the default branch:

net := "tcp"
switch net {
case "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6":
	fmt.Println("Should match")
case "ip", "ip4", "ip6":
	fmt.Println("shouldn't match")
default:
	log.Fatal("broken")
}

Altering this line to just three options runs successfully.

case "tcp", "tcp4", "tcp6":

from life.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.