diff options
Diffstat (limited to 'version/useragent.go')
-rw-r--r-- | version/useragent.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/version/useragent.go b/version/useragent.go index 1c1adf55..3b5240c6 100644 --- a/version/useragent.go +++ b/version/useragent.go @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT * - * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved. */ package version @@ -10,11 +10,17 @@ import ( "runtime" ) -// #include "version.h" -import "C" - -const Number = C.WIREGUARD_WINDOWS_VERSION_STRING +func Arch() string { + switch runtime.GOARCH { + case "arm", "arm64", "amd64": + return runtime.GOARCH + case "386": + return "x86" + default: + panic("Unrecognized GOARCH") + } +} func UserAgent() string { - return fmt.Sprintf("WireGuard/%s (%s; %s)", Number, OsName(), runtime.GOARCH) + return fmt.Sprintf("WireGuard/%s (%s; %s)", Number, OsName(), Arch()) } |