diff --git a/debian/local.go b/debian/local.go index a63adb0c..2daece04 100644 --- a/debian/local.go +++ b/debian/local.go @@ -23,9 +23,6 @@ type LocalRepo struct { // NewLocalRepo creates new instance of Debian local repository func NewLocalRepo(name string, comment string) *LocalRepo { - if comment == "" { - comment = "local repo" - } return &LocalRepo{ UUID: uuid.New(), Name: name, @@ -35,7 +32,10 @@ func NewLocalRepo(name string, comment string) *LocalRepo { // String interface func (repo *LocalRepo) String() string { - return fmt.Sprintf("[%s]: %s", repo.Name, repo.Comment) + if repo.Comment != "" { + return fmt.Sprintf("[%s]: %s", repo.Name, repo.Comment) + } + return fmt.Sprintf("[%s]", repo.Name) } // NumPackages return number of packages in local repo diff --git a/debian/local_test.go b/debian/local_test.go index 93fd15f6..9bc21698 100644 --- a/debian/local_test.go +++ b/debian/local_test.go @@ -33,7 +33,7 @@ func (s *LocalRepoSuite) TearDownTest(c *C) { func (s *LocalRepoSuite) TestString(c *C) { c.Check(NewLocalRepo("lrepo", "My first repo").String(), Equals, "[lrepo]: My first repo") - c.Check(NewLocalRepo("lrepo2", "").String(), Equals, "[lrepo2]: local repo") + c.Check(NewLocalRepo("lrepo2", "").String(), Equals, "[lrepo2]") } func (s *LocalRepoSuite) TestNumPackages(c *C) {