vendor gopreload

This commit is contained in:
Cadey Ratio 2017-03-27 21:30:31 -07:00
parent a009a9fd0f
commit 0ba19b0259
3 changed files with 34 additions and 0 deletions

View File

@ -94,3 +94,4 @@ a1a5df8f92af764f378f07d6a3dd8eb3f7aa190a github.com/xtaci/smux
6c23252515492caf9b228a9d5cabcdbde29f7f82 golang.org/x/net/internal/netreflect 6c23252515492caf9b228a9d5cabcdbde29f7f82 golang.org/x/net/internal/netreflect
6c23252515492caf9b228a9d5cabcdbde29f7f82 golang.org/x/net/ipv4 6c23252515492caf9b228a9d5cabcdbde29f7f82 golang.org/x/net/ipv4
8bf1e9bacbf65b10c81d0f4314cf2b1ebef728b5 github.com/streamrail/concurrent-map 8bf1e9bacbf65b10c81d0f4314cf2b1ebef728b5 github.com/streamrail/concurrent-map
a00a8beb369cafd88bb7b32f31fc4ff3219c3565 github.com/Xe/gopreload

7
vendor/github.com/Xe/gopreload/doc.go generated vendored Normal file
View File

@ -0,0 +1,7 @@
/*
Package gopreload is a bit of a hack to emulate the behavior of LD_PRELOAD [ld-preload].
This allows you to have automatically starting instrumentation, etc.
[ld-preload]: http://man7.org/linux/man-pages/man8/ld.so.8.html (see LD_PRELOAD section)
*/
package gopreload

26
vendor/github.com/Xe/gopreload/preload.go generated vendored Normal file
View File

@ -0,0 +1,26 @@
//+build linux,go1.8
package gopreload
import (
"log"
"os"
"plugin"
"strings"
)
func init() {
gpv := os.Getenv("GO_PRELOAD")
if gpv == "" {
return
}
for _, elem := range strings.Split(gpv, ",") {
log.Printf("gopreload: trying to open: %s", elem)
_, err := plugin.Open(elem)
if err != nil {
log.Printf("%v from GO_PRELOAD cannot be loaded: %v", elem, err)
continue
}
}
}