.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / copyright / copyright_test.go
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
5 package copyright
6
7 import (
8         "os"
9         "path/filepath"
10         "strings"
11         "testing"
12 )
13
14 func TestToolsCopyright(t *testing.T) {
15         cwd, err := os.Getwd()
16         if err != nil {
17                 t.Fatal(err)
18         }
19         tools := filepath.Dir(cwd)
20         if !strings.HasSuffix(filepath.Base(tools), "tools") {
21                 t.Fatalf("current working directory is %s, expected tools", tools)
22         }
23         files, err := checkCopyright(tools)
24         if err != nil {
25                 t.Fatal(err)
26         }
27         if len(files) > 0 {
28                 t.Errorf("The following files are missing copyright notices:\n%s", strings.Join(files, "\n"))
29         }
30 }