Add Rel() accessor to package

This commit is contained in:
Ettore Di Giacinto 2019-11-04 12:36:31 +01:00
parent 4dab89d209
commit 9dc8fccd12
No known key found for this signature in database
GPG Key ID: 1ADA699B145A2D1C

View File

@ -17,6 +17,7 @@ package pkg
import ( import (
"fmt" "fmt"
"path/filepath"
"github.com/crillab/gophersat/bf" "github.com/crillab/gophersat/bf"
version "github.com/hashicorp/go-version" version "github.com/hashicorp/go-version"
@ -57,6 +58,7 @@ type Package interface {
SetPath(string) SetPath(string)
GetPath() string GetPath() string
Rel(string) string
} }
type PackageSet interface { type PackageSet interface {
@ -122,6 +124,11 @@ func (p *DefaultPackage) GetPath() string {
return p.Path return p.Path
} }
func (p *DefaultPackage) Rel(s string) string {
return filepath.Join(p.GetPath(), s)
}
func (p *DefaultPackage) SetPath(s string) { func (p *DefaultPackage) SetPath(s string) {
p.Path = s p.Path = s
} }