From e24acf13600f9d6cc2d7a800ac71abaa006798c4 Mon Sep 17 00:00:00 2001 From: NNdroid <99177648+NNdroid@users.noreply.github.com> Date: Fri, 25 Aug 2023 20:20:10 +0800 Subject: [PATCH] optimize code. --- app/app.go | 5 +++-- main.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 9076794..c2906db 100644 --- a/app/app.go +++ b/app/app.go @@ -1,6 +1,7 @@ package app import ( + "github.com/net-byte/vtun/common" "github.com/net-byte/vtun/common/cipher" "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/netutil" @@ -38,10 +39,10 @@ type App struct { Iface *water.Interface } -func NewApp(config *config.Config, version string) *App { +func NewApp(config *config.Config) *App { return &App{ Config: config, - Version: version, + Version: common.Version, } } diff --git a/main.go b/main.go index 530ea66..2b7a872 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ func main() { log.Fatalf("Failed to load config from file: %s", err) } } - app := app.NewApp(&cfg, common.Version) + app := app.NewApp(&cfg) app.InitConfig() go app.StartApp() quit := make(chan os.Signal, 1)