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 "log" |
| 9 "sync/atomic" |
| 10 ) |
| 11 |
| 12 // BaseWalker implements Walker. It counts the number of files of each type. |
| 13 type BaseWalker struct { |
| 14 smallfiles uint64 |
| 15 largefiles uint64 |
| 16 } |
| 17 |
| 18 func (n *BaseWalker) SmallFile(filename string, alldata []byte) { |
| 19 atomic.AddUint64(&n.smallfiles, 1) |
| 20 } |
| 21 func (n *BaseWalker) LargeFile(filename string) { |
| 22 atomic.AddUint64(&n.largefiles, 1) |
| 23 } |
| 24 func (n *BaseWalker) Error(pathname string, err error) { |
| 25 log.Fatalf("%s:%s", pathname, err) |
| 26 } |
| 27 func (n *BaseWalker) Finished() { |
| 28 } |
OLD | NEW |