Skip to content

Conversation

@drewwyatt
Copy link
Owner

@drewwyatt drewwyatt commented Apr 26, 2019

  • Git now has a constructor that takes a directory
  • Directory is used for every command executed by execGitCommand
  • Pass flag.Arg(0) to new Git constructor in main

- Git now has a constructor that takes a directory
- Directory is used for every command executed by execGitCommand
@drewwyatt drewwyatt mentioned this pull request Apr 26, 2019
@drewwyatt drewwyatt added this to the 0.3.0 milestone Apr 26, 2019
}

// NewExecutor Constructor for git executor
func NewExecutor(directory string) Git {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it weird that this returns a Git, but your other functions take/return a *Git?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I actually tried returning a *Git first, and the compiler complained.

The way I have come to understand this is that NewExecutor returns a Git, because it is creating a new instance that isn't yet being referenced anywhere? (this may be flawed reasoning)

@drewwyatt drewwyatt merged commit 4d9a025 into master Apr 26, 2019
@drewwyatt drewwyatt deleted the dw/directory branch April 27, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants