(t time.Time)
| 170 | } |
| 171 | |
| 172 | func sourceFilesLaterThan(t time.Time) bool { |
| 173 | foundLater := false |
| 174 | err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error { |
| 175 | if err != nil { |
| 176 | // Ignore errors that occur when the project contains a symlink to a filesystem or volume that |
| 177 | // Windows doesn't have access to. |
| 178 | if path != "." && isAccessDenied(err) { |
| 179 | fmt.Fprintf(os.Stderr, "%s: %v\n", path, err) |
| 180 | return nil |
| 181 | } |
| 182 | return err |
| 183 | } |
| 184 | if foundLater { |
| 185 | return filepath.SkipDir |
| 186 | } |
| 187 | if len(path) > 1 && (path[0] == '.' || path[0] == '_') { |
| 188 | if info.IsDir() { |
| 189 | return filepath.SkipDir |
| 190 | } else { |
| 191 | return nil |
| 192 | } |
| 193 | } |
| 194 | if info.IsDir() { |
| 195 | if name := filepath.Base(path); name == "vendor" || name == "node_modules" { |
| 196 | return filepath.SkipDir |
| 197 | } |
| 198 | return nil |
| 199 | } |
| 200 | if path == "go.mod" || path == "go.sum" || (strings.HasSuffix(path, ".go") && !strings.HasSuffix(path, "_test.go")) { |
| 201 | if info.ModTime().After(t) { |
| 202 | foundLater = true |
| 203 | } |
| 204 | } |
| 205 | return nil |
| 206 | }) |
| 207 | if err != nil { |
| 208 | panic(err) |
| 209 | } |
| 210 | return foundLater |
| 211 | } |
| 212 | |
| 213 | func isAccessDenied(err error) bool { |
| 214 | var pe *os.PathError |
no test coverage detected