OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. |
| 4 |
| 5 package main |
| 6 |
| 7 import ( |
| 8 "io" |
| 9 "io/ioutil" |
| 10 ) |
| 11 |
| 12 // ReadFileProcessor implements FileProcessor. It reads the contents of each fou
nd file. |
| 13 type ReadFileProcessor struct { |
| 14 BaseFileProcessor |
| 15 } |
| 16 |
| 17 func (p *ReadFileProcessor) ReadFile(path string, r io.Reader) { |
| 18 _, err := io.Copy(ioutil.Discard, r) |
| 19 if err != nil { |
| 20 p.Error(path, err) |
| 21 } |
| 22 } |
| 23 |
| 24 func (p *ReadFileProcessor) SmallFile(path string, r io.ReadCloser) { |
| 25 p.ReadFile(path, r) |
| 26 p.BaseFileProcessor.SmallFile(path, r) |
| 27 } |
| 28 |
| 29 func (p *ReadFileProcessor) LargeFile(path string, r io.ReadCloser) { |
| 30 p.ReadFile(path, r) |
| 31 p.BaseFileProcessor.LargeFile(path, r) |
| 32 } |
OLD | NEW |