Stream opens a stream reading from the executable of the current process binary (os.Args[0] after path cleaning).
()
| 36 | |
| 37 | // Stream opens a stream reading from the executable of the current process binary (os.Args[0] after path cleaning). |
| 38 | func Stream() (io.ReadCloser, error) { |
| 39 | return os.Open(filepath.Clean(os.Args[0])) //nolint:gosec // reading our own binary |
| 40 | } |
| 41 | |
| 42 | // StreamByName opens a stream reading from an executable given its name |
| 43 | func StreamByName(name string) (io.ReadCloser, error) { |