mirror of
https://github.com/net-byte/vtun
synced 2024-03-14 10:50:03 +08:00
optimize code.
This commit is contained in:
parent
48f6f439a1
commit
e24acf1360
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user