Skip to content

Commit d638517

Browse files
committed
refactor(vcs): Shorten names
1 parent 915f55e commit d638517

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

analyzers/golang/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (a *Analyzer) Project(pkg string) (Project, error) {
7070
tool, manifestDir, err := NearestLockfile(dir)
7171

7272
// Find the nearest VCS repository.
73-
_, repoRoot, err := vcs.NearestVCS(dir)
73+
_, repoRoot, err := vcs.Nearest(dir)
7474
if err != nil {
7575
return Project{}, err
7676
}

vcs/vcs.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ var (
1616
ErrNoNearestVCS = errors.New("could not find nearest VCS repository in directory")
1717
)
1818

19-
// VCSIn returns the type of VCS repository rooted at a directory, or
19+
// In returns the type of VCS repository rooted at a directory, or
2020
// ErrNoVCSInDir if none is found.
21-
func vcsIn(dirname string) (VCS, error) {
21+
func In(dirname string) (VCS, error) {
2222
for _, vcs := range Types {
2323
ok, err := files.ExistsFolder(filepath.Join(dirname, MetadataFolder(vcs)))
2424
if err != nil {
@@ -31,12 +31,12 @@ func vcsIn(dirname string) (VCS, error) {
3131
return 0, ErrNoVCSInDir
3232
}
3333

34-
// NearestVCS returns the type and directory of the nearest VCS repository
34+
// Nearest returns the type and directory of the nearest VCS repository
3535
// containing the directory, or ErrNoNearestVCS if none is found.
36-
func NearestVCS(dirname string) (VCS, string, error) {
36+
func Nearest(dirname string) (VCS, string, error) {
3737
var vcs VCS
3838
dir, err := files.WalkUp(dirname, func(d string) error {
39-
tool, err := vcsIn(d)
39+
tool, err := In(d)
4040
if err == ErrNoVCSInDir {
4141
return nil
4242
}
@@ -56,7 +56,7 @@ func NearestVCS(dirname string) (VCS, string, error) {
5656
// errutil.ErrRepositoryNotFound if none is found, or errutil.ErrNotImplemented
5757
// if an unsupported VCS is found.
5858
func GetRepository(dirname string) (string, error) {
59-
vcs, dir, err := NearestVCS(dirname)
59+
vcs, dir, err := Nearest(dirname)
6060
if err == ErrNoNearestVCS {
6161
return "", errutil.ErrRepositoryNotFound
6262
}

0 commit comments

Comments
 (0)