Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit d31c621

Browse files
authored
Merge pull request #690 from jmank88/analyzer_project_docs
Document Analyzer and Project
2 parents dc2413a + c2491a6 commit d31c621

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

analyzer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/golang/dep/internal/gps"
1313
)
1414

15+
// Analyzer implements gps.ProjectAnalyzer.
1516
type Analyzer struct{}
1617

1718
// HasDepMetadata determines if a dep manifest exists at the specified path.
@@ -21,6 +22,8 @@ func (a Analyzer) HasDepMetadata(path string) bool {
2122
return err == nil && fileOK
2223
}
2324

25+
// DeriveManifestAndLock reads and returns the manifest at path/ManifestName or nil if one is not found.
26+
// The Lock is always nil for now.
2427
func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
2528
if !a.HasDepMetadata(path) {
2629
return nil, nil, nil
@@ -42,6 +45,7 @@ func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Man
4245
return m, nil, nil
4346
}
4447

48+
// Info returns the name and version of this ProjectAnalyzer.
4549
func (a Analyzer) Info() (string, int) {
4650
return "dep", 1
4751
}

project.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ func findProjectRoot(from string) (string, error) {
3939
}
4040
}
4141

42+
// A Project holds a Manifest and optional Lock for a project.
4243
type Project struct {
4344
// AbsRoot is the absolute path to the root directory of the project.
4445
AbsRoot string
4546
// ImportRoot is the import path of the project's root directory.
4647
ImportRoot gps.ProjectRoot
4748
Manifest *Manifest
48-
Lock *Lock
49+
Lock *Lock // Optional
4950
}
5051

5152
// MakeParams is a simple helper to create a gps.SolveParameters without setting

0 commit comments

Comments
 (0)