Thanks to visit codestin.com
Credit goes to github.com

Skip to content

基于Go语言的服务程序框架,可以在windwos、macos、linux等系统下开发服务程序

Notifications You must be signed in to change notification settings

xxl6097/service-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go get github.com/kardianos/service

go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go

CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build-trimpath -ldflags "-linkmode internal" -o AAServiceApp.exe main.go

go get -u github.com/xxl6097/[email protected]

goversioninfo -manifest versioninfo.json

windows打包

1、 main.go 文件中添加标签,如下

// /// //go:generate goversioninfo -icon=resource/icon.ico -manifest=resource/goversioninfo.exe.manifest
//go:generate goversioninfo -icon=resource/icon.ico -manifest=resource/goversioninfo.exe.manifest
func main() {
}

2、编译打包

go generate
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-linkmode internal $ldflags" -o ${appname}_${version}_windows_amd64.exe

3、生成版本信息 resource文件夹

About

基于Go语言的服务程序框架,可以在windwos、macos、linux等系统下开发服务程序

Resources

Stars

Watchers

Forks

Packages

No packages published