Browse Source

update version format

pull/15/head
Jason 5 years ago
parent
commit
5115e74d66
  1. 3
      Makefile
  2. 7
      cmd/tun2socks/main.go

3
Makefile

@ -2,9 +2,8 @@ NAME=tun2socks
BUILDDIR=$(shell pwd)/build
CMDDIR=$(shell pwd)/cmd/tun2socks
VERSION=$(shell git describe --tags --long || echo "unknown version")
BUILDTIME=$(shell date -u)
BUILD_TAGS='socks fakedns d stats'
BUILD_LDFLAGS='-s -w -X "main.version=$(VERSION)" -X "main.buildTime=$(BUILDTIME)"'
BUILD_LDFLAGS='-s -w -X "main.version=$(VERSION)"'
GOBUILD=go build -ldflags $(BUILD_LDFLAGS) -v -tags $(BUILD_TAGS)
all: build

7
cmd/tun2socks/main.go

@ -22,8 +22,8 @@ import (
const MTU = 1500
var (
version = "unknown version"
buildTime = "unknown time"
version = "unknown version"
description = "A tun2socks implementation written in Go."
args = new(CmdArgs)
postFlagsInitFn = make([]func(), 0)
@ -65,7 +65,8 @@ func registerHandlerCreator(name string, creator func()) {
}
func showVersion() {
fmt.Println("tun2socks", version, buildTime)
fmt.Println("Go-tun2socks", version)
fmt.Println(description)
}
func main() {

Loading…
Cancel
Save