• 2024-12-07go: 从git得到版本信息的脚本
    一,脚本:#!/bin/bashgitTag=$(if["`gitdescribe--tags--abbrev=02>/dev/null`"!=""];thengitdescribe--tags--abbrev=0;elsegitlog--pretty=format:'%h'-n1;fi)echo$gitTag;buildDate=$(TZ=Asia/Shanghaidate+%Y-%
  • 2024-11-23golang: 给二进制文件增加版本信息
    一,代码:packagemainimport( "embed" "flag" "github.com/gofiber/template/html/v2" "net/http" "fmt" "runtime" "industry/config" "industry/routes")//构建版本信息var( V