Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow identification of type of PathOrContent #16

Merged
merged 5 commits into from
Aug 17, 2022

Conversation

douglascamata
Copy link
Contributor

Signed-off-by: Douglas Camata 159076+douglascamata@users.noreply.github.com

I wanted to integrate extkingpin.PathOrContent with https://github.com/fsnotify/fsnotify to reload configuration when a path is used and the indicated file changes, but it's not achievable without this.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Copy link
Contributor

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice, just those fields cannot be nil, which can simplify the code.

extkingpin/pathorcontent.go Outdated Show resolved Hide resolved
Comment on lines 102 to 107
func (p *PathOrContent) Path() string {
if p.path != nil {
return *p.path
}
return ""
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func (p *PathOrContent) Path() string {
if p.path != nil {
return *p.path
}
return ""
}
func (p *PathOrContent) Path() string {
return *p.path
}

This is enough.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Copy link
Contributor

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks!

@bwplotka bwplotka merged commit 6c25e3b into efficientgo:main Aug 17, 2022
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.

2 participants