问题描述

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屋!