(notationCmd *exec.Cmd)
| 98 | } |
| 99 | |
| 100 | func processNotationIO(notationCmd *exec.Cmd) error { |
| 101 | stdout, err := notationCmd.StdoutPipe() |
| 102 | if err != nil { |
| 103 | log.L.Warn("notation: " + err.Error()) |
| 104 | } |
| 105 | stderr, err := notationCmd.StderrPipe() |
| 106 | if err != nil { |
| 107 | log.L.Warn("notation: " + err.Error()) |
| 108 | } |
| 109 | if err := notationCmd.Start(); err != nil { |
| 110 | // only return err if it's critical (notation start failed.) |
| 111 | return err |
| 112 | } |
| 113 | |
| 114 | scanner := bufio.NewScanner(stdout) |
| 115 | for scanner.Scan() { |
| 116 | log.L.Info("notation: " + scanner.Text()) |
| 117 | } |
| 118 | if err := scanner.Err(); err != nil { |
| 119 | log.L.Warn("notation: " + err.Error()) |
| 120 | } |
| 121 | |
| 122 | errScanner := bufio.NewScanner(stderr) |
| 123 | for errScanner.Scan() { |
| 124 | log.L.Info("notation: " + errScanner.Text()) |
| 125 | } |
| 126 | if err := errScanner.Err(); err != nil { |
| 127 | log.L.Warn("notation: " + err.Error()) |
| 128 | } |
| 129 | |
| 130 | return nil |
| 131 | } |
no test coverage detected
searching dependent graphs…