或者类似 web 框架,打包成一个二进制文件,直接执行就可以提供 web 服务?
|
1
可以的
|
|
2
这还用问吗?当然可以
|
|
3
是方便啊,类似 spring boot 的 java -jar app.jar
看来真有必要玩一玩了 |
|
4
非常可以,而且可以编译成任意平台的可执行程序
|
|
5
可以啊,这是 Go 语言的特色
|
|
6
个人感觉跟`java -jar`还是有区别的, 它这个不需要安装什么 go 运行环境。
|
|
lllllliiiiJul 5, 2022
8
@idblife
#7 我也在尝试写 go 玩玩,哈哈 |
|
wdwwtzyJul 5, 2022
9
|
|
dzdhJul 5, 2022
10
// go:embed *.html *.css *.js
var FS embed.FS http.handle( http.Filesystem(xxx.FS)) |
|
dzdhJul 5, 2022
11
|
|
12
可以的. 静态资源用 embed
|
|
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 |
|
zhengjianyangJul 5, 2022
15
这不是基本需求吗
|