Adds doc comments

This commit is contained in:
sm
2018-03-02 23:23:08 -08:00
parent f21ded2b77
commit 2a0220cddc
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -2,6 +2,7 @@ package pm
import "errors" import "errors"
// Meta tracks metadata for a package
type Meta struct { type Meta struct {
Name Name `json:"name"` Name Name `json:"name"`
Version Version `json:"version"` Version Version `json:"version"`
@@ -9,6 +10,7 @@ type Meta struct {
Namespace string `json:"namespace"` Namespace string `json:"namespace"`
} }
// Valid validates the contents of a Meta for requires fields.
func (m *Meta) Valid() (bool, error) { func (m *Meta) Valid() (bool, error) {
if m.Name == "" { if m.Name == "" {
return false, errors.New("name cannot be empty") return false, errors.New("name cannot be empty")
+1 -1
View File
@@ -46,7 +46,7 @@ func Add(root string, uris []string) error {
return save(root, db) 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 { func Remove(root string, uris []string) error {
db, err := load(root) db, err := load(root)
if err != nil { if err != nil {