-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy patherrors.go
More file actions
38 lines (31 loc) · 706 Bytes
/
Copy patherrors.go
File metadata and controls
38 lines (31 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
)
const (
UnusedDep = "unused-dep"
UnmanagedImport = "unmanaged-import"
)
type ProjectError struct {
Kind string
Message string
}
func UnusedDependencyError(importPath string) *ProjectError {
return &ProjectError{
UnusedDep,
fmt.Sprintf("%s in gopack.config is unused\n", importPath),
}
}
func UnmanagedImportError(s *ImportStats) *ProjectError {
msg := fmt.Sprintf("%s referenced in the following locations but not managed in gopack.config\n%s", s.Path, s.ReferenceList())
return &ProjectError{
UnmanagedImport,
msg,
}
}
func (e *ProjectError) String() string {
return e.Message
}
func (e *ProjectError) Error() string {
return e.String()
}