copied from action.openPassphraseFile TODO: should we move this to pkg/action so we can reuse the func from there?
(passphraseFile string, stdin *os.File)
| 202 | // copied from action.openPassphraseFile |
| 203 | // TODO: should we move this to pkg/action so we can reuse the func from there? |
| 204 | func openPassphraseFile(passphraseFile string, stdin *os.File) (*os.File, error) { |
| 205 | if passphraseFile == "-" { |
| 206 | stat, err := stdin.Stat() |
| 207 | if err != nil { |
| 208 | return nil, err |
| 209 | } |
| 210 | if (stat.Mode() & os.ModeNamedPipe) == 0 { |
| 211 | return nil, errors.New("specified reading passphrase from stdin, without input on stdin") |
| 212 | } |
| 213 | return stdin, nil |
| 214 | } |
| 215 | return os.Open(passphraseFile) |
| 216 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…