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 "fmt" |
| 9 "io" |
| 10 ) |
| 11 |
| 12 // PrintWalker implements Walker. It prints the filename of each found file. |
| 13 type PrintWalker struct { |
| 14 BaseWalker |
| 15 obuf io.Writer |
| 16 } |
| 17 |
| 18 func (p *PrintWalker) PrintFile(filename string) { |
| 19 fmt.Fprintln(p.obuf, filename) |
| 20 } |
| 21 |
| 22 func (p *PrintWalker) SmallFile(filename string, alldata []byte) { |
| 23 p.BaseWalker.SmallFile(filename, alldata) |
| 24 p.PrintFile(filename) |
| 25 } |
| 26 |
| 27 func (p *PrintWalker) LargeFile(filename string) { |
| 28 p.BaseWalker.LargeFile(filename) |
| 29 p.PrintFile(filename) |
| 30 } |
OLD | NEW |