fix(cfsauto): fix build time for -V option

Signed-off-by: Till <lleiiell@live.com>
This commit is contained in:
Till 2023-05-18 15:15:57 +08:00 committed by leonrayang
parent 31797d462a
commit dbea75ee76
2 changed files with 8 additions and 3 deletions

View File

@ -5,7 +5,7 @@ automount tool for [cubefs](https://github.com/cubefs/cubefs)
## build
```bash
go build -v -ldflags="-X main.buildVersion=1.1" -o /usr/local/bin
go build -v -ldflags="-X main.buildVersion=1.1 -X 'main.buildDate=$(date '+%Y-%m-%d %H:%M:%S')'" -o /usr/local/bin
```
## quick start
@ -23,6 +23,12 @@ cfsauto
cfsauto -V
example:
```bash
Version: 1.1, BuildDate: 2023-05-18 15:08:00
```
## LDAP automount example

View File

@ -5,11 +5,10 @@ import (
"github.com/spf13/cobra"
"log"
"os"
"time"
)
var buildVersion = "DebugVersion"
var buildDate = time.Now().String()
var buildDate = "BuildDate"
var logFile *os.File