mirror of
https://github.com/amnezia-vpn/euphoria-windows.git
synced 2026-05-17 08:15:59 +03:00
29 lines
513 B
Go
29 lines
513 B
Go
/* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
|
|
*/
|
|
|
|
package version
|
|
|
|
import (
|
|
"runtime/debug"
|
|
"strings"
|
|
)
|
|
|
|
func ProtoImplementation() string {
|
|
info, ok := debug.ReadBuildInfo()
|
|
if !ok {
|
|
return "unknown"
|
|
}
|
|
for _, dep := range info.Deps {
|
|
if dep.Path == "golang.zx2c4.com/wireguard" {
|
|
parts := strings.Split(dep.Version, "-")
|
|
if len(parts) == 3 && len(parts[2]) == 12 {
|
|
return parts[2][:7]
|
|
}
|
|
return dep.Version
|
|
}
|
|
}
|
|
return "unknown"
|
|
}
|