如何在golang中动态运行函数? [英] How to run function dynamically in golang?

查看:115
本文介绍了如何在golang中动态运行函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

play.golang.org在内部如何编译和运行go代码?

How internally play.golang.org compiles and run the go code?

我有一个字符串功能.我需要检查语法并在golang main函数中运行代码.

I have a function as string. I need to check the syntax and run the code inside golang main function.

推荐答案

将代码发送到服务器进行编译和执行,然后将输出发送回客户端(浏览器).

The code is sent to a server to be compiled and executed then the output is sent back to the client (the browser).

有一篇有关其工作原理的文章: https://blog.golang.org/playground

There is an article on how it works : https://blog.golang.org/playground

这篇关于如何在golang中动态运行函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆