Skip to content

Commit

Permalink
Allow identification of type of PathOrContent (#16)
Browse files Browse the repository at this point in the history
* Allow identification of type of PathOrContent

Signed-off-by: Douglas Camata <[email protected]>

* Remove nil checks

Signed-off-by: Douglas Camata <[email protected]>

* Revert access to path and content

Signed-off-by: Douglas Camata <[email protected]>

* Fix Path() comment

Signed-off-by: Douglas Camata <[email protected]>

* Fix last check for path's presence

Signed-off-by: Douglas Camata <[email protected]>

Signed-off-by: Douglas Camata <[email protected]>
  • Loading branch information
douglascamata committed Aug 17, 2022
1 parent 3312908 commit 6c25e3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extkingpin/pathorcontent.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ func (p *PathOrContent) Content() ([]byte, error) {
return content, nil
}

// Path returns the file's path.
func (p *PathOrContent) Path() string {
return *p.path
}

// WithRequired allows you to override default required option.
func WithRequired() Option {
return func(p *PathOrContent) {
Expand Down

0 comments on commit 6c25e3b

Please sign in to comment.