The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
idblife
7.51D

不懂就问:用 goframe 写的工程可以打包成一个二进制文件?

  •  
  •   idblife · Jul 5, 2022 · 2513 views
    This topic created in 1420 days ago, the information mentioned may be changed or developed.
    或者类似 web 框架,打包成一个二进制文件,直接执行就可以提供 web 服务?
    15 replies    2022-07-05 22:56:28 +08:00
    gimp
        1
    gimp  
       Jul 5, 2022   ❤️ 1
    可以的
    keepeye
        2
    keepeye  
       Jul 5, 2022   ❤️ 1
    这还用问吗?当然可以
    idblife
        3
    idblife  
    OP
       Jul 5, 2022
    是方便啊,类似 spring boot 的 java -jar app.jar
    看来真有必要玩一玩了
    GogoGo666
        4
    GogoGo666  
       Jul 5, 2022   ❤️ 1
    非常可以,而且可以编译成任意平台的可执行程序
    bigbigpark
        5
    bigbigpark  
       Jul 5, 2022   ❤️ 1
    可以啊,这是 Go 语言的特色
    lllllliiii
        6
    lllllliiii  
       Jul 5, 2022   ❤️ 1
    个人感觉跟`java -jar`还是有区别的, 它这个不需要安装什么 go 运行环境。
    idblife
        7
    idblife  
    OP
       Jul 5, 2022 via iPhone
    @fzdwx
    哈哈,这点很不错
    lllllliiii
        8
    lllllliiii  
       Jul 5, 2022
    @idblife
    #7 我也在尝试写 go 玩玩,哈哈
    dzdh
        10
    dzdh  
       Jul 5, 2022
    // go:embed *.html *.css *.js
    var FS embed.FS

    http.handle( http.Filesystem(xxx.FS))
    dzdh
        11
    dzdh  
       Jul 5, 2022
    qfdk
        12
    qfdk  
    PRO
       Jul 5, 2022 via iPhone
    可以的. 静态资源用 embed
    idblife
        13
    idblife  
    OP
       Jul 5, 2022 via iPhone
    @wdwwtzy
    能方便的跨平台吗?
    wdwwtzy
        14
    wdwwtzy  
       Jul 5, 2022   ❤️ 1
    @idblife
    必须的么


    Examples
    Publish an app self-contained. A macOS 64-bit executable is created.
    dotnet publish -r osx-x64
    Publish an app self-contained. A Windows 64-bit executable is created.
    dotnet publish -r win-x64


    https://docs.microsoft.com/en-us/dotnet/core/deploying/#examples-1
    zhengjianyang
        15
    zhengjianyang  
       Jul 5, 2022
    这不是基本需求吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1491 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 61ms · UTC 16:46 · PVG 00:46 · LAX 09:46 · JFK 12:46
    ♥ Do have faith in what you're doing.