mirror of https://github.com/libp2p/go-libp2p.git
Marten Seemann
2 years ago
committed by
GitHub
3 changed files with 6 additions and 29 deletions
@ -1,22 +0,0 @@ |
|||
//go:build !go1.18
|
|||
|
|||
package identify |
|||
|
|||
import ( |
|||
"fmt" |
|||
"runtime/debug" |
|||
) |
|||
|
|||
func init() { |
|||
bi, ok := debug.ReadBuildInfo() |
|||
// ok will only be true if this is built as a dependency of another module
|
|||
if !ok { |
|||
return |
|||
} |
|||
version := bi.Main.Version |
|||
if version == "(devel)" { |
|||
defaultUserAgent = bi.Main.Path |
|||
} else { |
|||
defaultUserAgent = fmt.Sprintf("%s@%s", bi.Main.Path, bi.Main.Version) |
|||
} |
|||
} |
@ -1,5 +1,3 @@ |
|||
//go:build go1.18
|
|||
|
|||
package identify |
|||
|
|||
import ( |
Loading…
Reference in new issue