Adds doc comments
This commit is contained in:
parent
f21ded2b77
commit
2a0220cddc
2
meta.go
2
meta.go
@ -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")
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user