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

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

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

    http.handle( http.Filesystem(xxx.FS))
    qfdk
    qfdk
    PRO
    Jul 5, 2022 via iPhone
    12
    可以的. 静态资源用 embed
    idblife
    idblife
    OP
    Jul 5, 2022 via iPhone
    13
    @wdwwtzy
    能方便的跨平台吗?
    wdwwtzy
    wdwwtzy
    Jul 5, 2022❤️1
    14
    @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
    zhengjianyang
    Jul 5, 2022
    15
    这不是基本需求吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1132 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 23:09 · PVG 07:09 · LAX 15:09 · JFK 18:09
    ♥ Do have faith in what you're doing.