Rebecca Stambler | d33bae4 | 2021-01-07 22:36:26 -0500 | [diff] [blame] | 1 | // Copyright 2020 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
Rebecca Stambler | 2758b04 | 2021-06-11 18:15:44 -0400 | [diff] [blame] | 5 | //go:build go1.18 |
| 6 | // +build go1.18 |
| 7 | |
Rebecca Stambler | d33bae4 | 2021-01-07 22:36:26 -0500 | [diff] [blame] | 8 | package copyright |
| 9 | |
| 10 | import ( |
Rebecca Stambler | d33bae4 | 2021-01-07 22:36:26 -0500 | [diff] [blame] | 11 | "strings" |
| 12 | "testing" |
| 13 | ) |
| 14 | |
| 15 | func TestToolsCopyright(t *testing.T) { |
Heschi Kreinick | 9e0a7b1 | 2023-04-27 10:15:48 -0400 | [diff] [blame] | 16 | files, err := checkCopyright("..") |
Rebecca Stambler | d33bae4 | 2021-01-07 22:36:26 -0500 | [diff] [blame] | 17 | if err != nil { |
| 18 | t.Fatal(err) |
| 19 | } |
| 20 | if len(files) > 0 { |
| 21 | t.Errorf("The following files are missing copyright notices:\n%s", strings.Join(files, "\n")) |
| 22 | } |
| 23 | } |