我可以将第三方软件包导入golang游乐场吗? [英] Can I import 3rd party package into golang playground

查看:165
本文介绍了我可以将第三方软件包导入golang游乐场吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Google搜索了一下,但没有回答。可能吗?如果是的话,该怎么办?



Go Playground链接: https://play.golang.org/

解决方案

Go Playground上最完整的文章仍然是 Go Go Playground内部,其中提到:


  • godoc / static / static.go (用于游乐场中显示的默认程序)
  • //github.com/golang/tools/tree/master/playgroundrel =nofollow noreferrer> golang / tools / playground playground / socket / socket.go 构建并执行pro这些进程不支持导入一个远程包(可以通过互联网访问)。 >
    这是一个非常独立的系统(您可以在本地运行,也可以在play.golang.org中使用它),并具有多个功能,如网络:


    像文件系统一样,操场的网络堆栈是一个由syscall包实现的进程内伪造。

    它允许游乐场项目使用回环接口(127.0.0.1)。

    对其他主​​机的请求将失败






    更新2017:



    您有其他选择:




    • iafan / goplayspace

    • xiam / go-playground



    • 但他们仍然使用官方Go Playground服务来构建和运行Go代码,因此仍然不允许外部导入。


      I googled but got no answer. Is it possible? If yes, how to do it?

      The Go Playground link: https://play.golang.org/

      解决方案

      The most complete article on Go Playground remains "Inside the Go Playground", which mentions:

      None of those processes support importing a remote package (that would be accessed over the internet).
      It is very much a self-contained system (that you can run locally as well as using it from play.golang.org), with multiple features stubbed or faked, like the network:

      Like the file system, the playground's network stack is an in-process fake implemented by the syscall package.
      It permits playground projects to use the loopback interface (127.0.0.1).
      Requests to other hosts will fail.


      Update 2017:

      You have alternatives:

      But they still use use the official Go Playground service to build and run Go code, so that would still not allow for external imports.

      这篇关于我可以将第三方软件包导入golang游乐场吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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