Adds doc comments

This commit is contained in:
Stephen McQuay 2018-03-02 23:23:08 -08:00
parent f21ded2b77
commit 2a0220cddc
Signed by untrusted user: sm
GPG Key ID: 4E4B72F479BA3CE5
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package pm
import "errors"
// Meta tracks metadata for a package
type Meta struct {
Name Name `json:"name"`
Version Version `json:"version"`
@ -9,6 +10,7 @@ type Meta struct {
Namespace string `json:"namespace"`
}
// Valid validates the contents of a Meta for requires fields.
func (m *Meta) Valid() (bool, error) {
if m.Name == "" {
return false, errors.New("name cannot be empty")

View File

@ -46,7 +46,7 @@ func Add(root string, uris []string) error {
return save(root, db)
}
// Add removes the given uri from the list of configured remotes.
// Remove removes the given uri from the list of configured remotes.
func Remove(root string, uris []string) error {
db, err := load(root)
if err != nil {