diff --git a/analyzer.go b/analyzer.go index a0a83a80..f2f17996 100644 --- a/analyzer.go +++ b/analyzer.go @@ -12,6 +12,7 @@ import ( "github.com/golang/dep/internal/gps" ) +// Analyzer implements gps.ProjectAnalyzer. type Analyzer struct{} // HasDepMetadata determines if a dep manifest exists at the specified path. @@ -21,6 +22,8 @@ func (a Analyzer) HasDepMetadata(path string) bool { return err == nil && fileOK } +// DeriveManifestAndLock reads and returns the manifest at path/ManifestName or nil if one is not found. +// The Lock is always nil for now. func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) { if !a.HasDepMetadata(path) { return nil, nil, nil @@ -42,6 +45,7 @@ func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Man return m, nil, nil } +// Info returns the name and version of this ProjectAnalyzer. func (a Analyzer) Info() (string, int) { return "dep", 1 } diff --git a/project.go b/project.go index 93a0ad3b..309316fb 100644 --- a/project.go +++ b/project.go @@ -39,13 +39,14 @@ func findProjectRoot(from string) (string, error) { } } +// A Project holds a Manifest and optional Lock for a project. type Project struct { // AbsRoot is the absolute path to the root directory of the project. AbsRoot string // ImportRoot is the import path of the project's root directory. ImportRoot gps.ProjectRoot Manifest *Manifest - Lock *Lock + Lock *Lock // Optional } // MakeParams is a simple helper to create a gps.SolveParameters without setting