Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Minor Refactorings #793

Merged
merged 15 commits into from
Dec 21, 2017
Merged

Minor Refactorings #793

merged 15 commits into from
Dec 21, 2017

Conversation

paganotoni
Copy link
Member

No description provided.

@@ -10,31 +10,51 @@ import (

//SMTPSender allows to send Emails by connecting to a SMTP server.
type SMTPSender struct {
Dialer *gomail.Dialer
Dialer *gomail.Dialer
message *gomail.Message
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sure this is a good idea to have the message here. How do you handle two concurrent Send?

@paganotoni
Copy link
Member Author

paganotoni commented Dec 14, 2017

@stanislas-m thanks the heads up, you're right! we better keep it as it was, that is, one gomail.Message instance per Send call.

func execIfExists(name string, pathName string, c *exec.Cmd) {
bb := os.Stdout

if _, err := exec.LookPath("mysql"); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysql is hard coded here, which I'm assuming is not right.


return nil
},
func execIfExists(name string, pathName string, c *exec.Cmd) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can clean up this function by passing in the infoCommand struct instead of all these args.

} else {
bb.WriteString("dep Not Found\n")
}
bb.WriteString("\n### Go Version\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this part of the bigger loop below?

} else {
bb.WriteString("dep Not Found\n")
}
bb.WriteString("\n### Go Env\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this part of the bigger loop below?

@paganotoni
Copy link
Member Author

@markbates All set on this one

@markbates
Copy link
Member

The only issue I've found with this is when I ran it against a project that didn't have Gopkg.toml file it returned an error status code, which isn't correct. It shouldn't return an error if one of things goes bad.

### Dep Status
no Gopkg.lock found. Run `dep ensure` to generate lock file
Usage:
  buffalo info [flags]

Flags:
  -h, --help   help for info

Error: exit status 1

@paganotoni
Copy link
Member Author

🤔 I just tried it with a newly created buffalo app (without Gopkg.toml) and did get :

### Dep Status
could not find project Gopkg.toml, use dep init to initiate a manifest

@markbates markbates merged commit ff2d55b into development Dec 21, 2017
@markbates markbates deleted the task/minor-refactorings branch December 21, 2017 16:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants