File tree Expand file tree Collapse file tree 1 file changed +17
-19
lines changed
Expand file tree Collapse file tree 1 file changed +17
-19
lines changed Original file line number Diff line number Diff line change 33package generator
44
55import (
6- "bytes"
76 "log"
8- "syscall/js"
97
108 wasmhttp "github.com/nlepage/go-wasm-http-server/v2"
119)
1210
1311var globalApp * App
1412
15- func wasmZip (this js.Value , cb []js.Value ) interface {} { //
13+ // func wasmZip(this js.Value, cb []js.Value) interface{} { //
1614
17- if globalApp == nil {
18- panic ("global app not configured. Run app.Run(os.Args)" )
19- }
15+ // if globalApp == nil {
16+ // panic("global app not configured. Run app.Run(os.Args)")
17+ // }
2018
21- b := bytes.Buffer {}
22- err := globalApp .WriteZip (& b )
23- if err != nil {
24- log .Printf ("error zipping: %s" , err .Error ())
25- }
19+ // b := bytes.Buffer{}
20+ // err := globalApp.WriteZip(&b)
21+ // if err != nil {
22+ // log.Printf("error zipping: %s", err.Error())
23+ // }
2624
27- log .Printf ("completed" )
25+ // log.Printf("completed")
2826
29- data := b .Bytes ()
27+ // data := b.Bytes()
3028
31- dst := js .Global ().Get ("Uint8Array" ).New (len (data ))
32- js .CopyBytesToJS (dst , data )
33- cb [0 ].Invoke (dst )
34- return dst
35- }
29+ // dst := js.Global().Get("Uint8Array").New(len(data))
30+ // js.CopyBytesToJS(dst, data)
31+ // cb[0].Invoke(dst)
32+ // return dst
33+ // }
3634
3735func os_setup (a * App ) {
38- js .Global ().Set ("zipGeometry" , js .FuncOf (wasmZip ))
36+ // js.Global().Set("zipGeometry", js.FuncOf(wasmZip))
3937 globalApp = a
4038}
4139
You can’t perform that action at this time.
0 commit comments