func (command ImplyCommand) addImplication(store *storage.Storage, tagName, impliedTagName string) error { tag, err := store.Db.TagByName(tagName) if err != nil { return fmt.Errorf("could not retrieve tag '%v': %v", tagName, err) } if tag == nil { return fmt.Errorf("no such tag '%v'.", tagName) } impliedTag, err := store.Db.TagByName(impliedTagName) if err != nil { return fmt.Errorf("could not retrieve tag '%v': %v", impliedTagName, err) } if impliedTag == nil { return fmt.Errorf("no such tag '%v'.", impliedTagName) } if command.verbose { log.Infof("adding tag implication of '%v' to '%v'.", tagName, impliedTagName) } if err = store.AddImplication(tag.Id, impliedTag.Id); err != nil { return fmt.Errorf("could not add tag implication of '%v' to '%v': %v", tagName, impliedTagName, err) } return nil }