Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(plugin): remove quotation mark about version and add default revision

LinkinStard538b531bd45
diff --git a/cmd/main.go b/cmd/main.go
index fe378b42..d3f2dae2 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -23,9 +23,9 @@ var (
// Version is the version of the project
Version = "0.0.0"
// Revision is the git short commit revision number
- Revision = ""
+ Revision = "-"
// Time is the build time of the project
- Time = ""
+ Time = "-"
// log level
logLevel = os.Getenv("LOG_LEVEL")
// log path
diff --git a/internal/cli/build.go b/internal/cli/build.go
index 0a6d3129..ddf7177b 100644
--- a/internal/cli/build.go
+++ b/internal/cli/build.go
@@ -192,7 +192,7 @@ func copyDirEntries(sourceFs embed.FS, sourceDir string, targetDir string) (err
func buildBinary(b *buildingMaterial) (err error) {
versionInfo := b.originalAnswerInfo
cmdPkg := "github.com/answerdev/answer/cmd"
- ldflags := fmt.Sprintf("-X %s.Version='%s' -X %s.Revision='%s' -X %s.Time='%s'",
+ ldflags := fmt.Sprintf("-X %s.Version=%s -X %s.Revision=%s -X %s.Time=%s",
cmdPkg, versionInfo.Version, cmdPkg, versionInfo.Revision, cmdPkg, versionInfo.Time)
err = b.newExecCmd("go", "build",
"-ldflags", ldflags, "-o", b.outputPath, ".").Run()