cmd/tailscaled: eliminate unnecessary use of an init() function.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
pull/395/head
Avery Pennarun 5 years ago
parent c5fcc38bf1
commit d074ec6571

@ -36,15 +36,12 @@ import (
// later, the global state key doesn't look like a username. // later, the global state key doesn't look like a username.
const globalStateKey = "_daemon" const globalStateKey = "_daemon"
var defaultTunName = "tailscale0" func main() {
defaultTunName := "tailscale0"
func init() {
if runtime.GOOS == "openbsd" { if runtime.GOOS == "openbsd" {
defaultTunName = "tun" defaultTunName = "tun"
} }
}
func main() {
fake := getopt.BoolLong("fake", 0, "fake tunnel+routing instead of tuntap") fake := getopt.BoolLong("fake", 0, "fake tunnel+routing instead of tuntap")
debug := getopt.StringLong("debug", 0, "", "Address of debug server") debug := getopt.StringLong("debug", 0, "", "Address of debug server")
tunname := getopt.StringLong("tun", 0, defaultTunName, "tunnel interface name") tunname := getopt.StringLong("tun", 0, defaultTunName, "tunnel interface name")

Loading…
Cancel
Save