Source File
user_agent.go
Belonging Package
github.com/libp2p/go-libp2p/p2p/protocol/identify/internal/user-agent
package useragentimport ()func () string {return defaultUserAgent}var defaultUserAgent = "github.com/libp2p/go-libp2p"func init() {, := debug.ReadBuildInfo()if ! {return}:= .Main.Version// version will only be non-empty if built as a dependency of another moduleif == "" {return}if != "(devel)" {defaultUserAgent = fmt.Sprintf("%s@%s", .Main.Path, .Main.Version)return}var stringvar boolfor , := range .Settings {switch .Key {case "vcs.revision":= .Valueif len() > 9 {= [:9]}case "vcs.modified":if .Value == "true" {= true}}}defaultUserAgent = fmt.Sprintf("%s@%s", .Main.Path, )if {defaultUserAgent += "-dirty"}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |