optimize code.

This commit is contained in:
NNdroid 2023-08-25 20:20:10 +08:00
parent 48f6f439a1
commit e24acf1360
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package app package app
import ( import (
"github.com/net-byte/vtun/common"
"github.com/net-byte/vtun/common/cipher" "github.com/net-byte/vtun/common/cipher"
"github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/config"
"github.com/net-byte/vtun/common/netutil" "github.com/net-byte/vtun/common/netutil"
@ -38,10 +39,10 @@ type App struct {
Iface *water.Interface Iface *water.Interface
} }
func NewApp(config *config.Config, version string) *App { func NewApp(config *config.Config) *App {
return &App{ return &App{
Config: config, Config: config,
Version: version, Version: common.Version,
} }
} }

View File

@ -51,7 +51,7 @@ func main() {
log.Fatalf("Failed to load config from file: %s", err) log.Fatalf("Failed to load config from file: %s", err)
} }
} }
app := app.NewApp(&cfg, common.Version) app := app.NewApp(&cfg)
app.InitConfig() app.InitConfig()
go app.StartApp() go app.StartApp()
quit := make(chan os.Signal, 1) quit := make(chan os.Signal, 1)