mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-04 16:37:12 -05:00
move Println to main
This commit is contained in:
parent
e9e6b21252
commit
242e65e424
14
core.go
14
core.go
@ -12,9 +12,7 @@ package core
|
|||||||
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg core -path Core
|
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg core -path Core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"v2ray.com/core/common/serial"
|
||||||
|
|
||||||
"v2ray.com/core/common/platform"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -30,10 +28,12 @@ func Version() string {
|
|||||||
return version
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrintVersion prints current version into console.
|
// VersionStatement returns a list of strings representing the full version info.
|
||||||
func PrintVersion() {
|
func VersionStatement() []string {
|
||||||
fmt.Printf("V2Ray %s (%s) %s%s", Version(), codename, build, platform.LineSeparator())
|
return []string{
|
||||||
fmt.Printf("%s%s", intro, platform.LineSeparator())
|
serial.Concat("V2Ray ", Version(), "(", codename, ")", build),
|
||||||
|
intro,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,10 +85,17 @@ func startV2Ray() (core.Server, error) {
|
|||||||
return server, nil
|
return server, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func printVersion() {
|
||||||
|
version := core.VersionStatement()
|
||||||
|
for _, s := range version {
|
||||||
|
fmt.Println(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
core.PrintVersion()
|
printVersion()
|
||||||
|
|
||||||
if *version {
|
if *version {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user