使用gopherjs可以把go转化为js在浏览器里运行。
比如js中的
document.write('Hello world');
用go来写:
js.Global.Get("document").Call("write", "Hello+world!")
go相比js有哪些优点?在什么情况需要这样玩呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我看了下,几乎对我没有实际的作用,不知道为啥这个东西会被发明出来...