1.centos部署go环境
vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go #go包的解压目录
export GOPATH=/opt/GOPATH #表示实际的工作目录
export PATH=$GOPATH/bin/:$PATH
source /etc/profile
2.打包go build main.go
3.后台启动nohup ./main &> web.log
4.查看web.log发现报错
panic: listen tcp ip:8090: bind: cannot assign requested address
5.解决
修改web服务启动ip地址为 0.0.0.0
重新打包启动即可