Skip to content

Commit

Permalink
Unexport functions and structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed May 20, 2018
1 parent 6b7ee97 commit 3f15788
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func getDepTree(pkgs []string, warnings *aurWarnings) (*depTree, error) {
err = checkVersions(dt)
}

dt.Warnings.Print()
dt.Warnings.print()

return dt, err
}
Expand Down
20 changes: 9 additions & 11 deletions print.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const arrow = "==>"
const smallArrow = " ->"

func (warnings *aurWarnings) Print() {
func (warnings *aurWarnings) print() {
if len(warnings.Missing) > 0 {
fmt.Print(bold(yellow(smallArrow)) + " Missing AUR Packages:")
for _, name := range warnings.Missing {
Expand Down Expand Up @@ -162,7 +162,7 @@ func (u upgrade) StylizedNameWithRepository() string {
}

// Print prints the details of the packages to upgrade.
func (u upSlice) Print() {
func (u upSlice) print() {
longestName, longestVersion := 0, 0
for _, pack := range u {
packNameLen := len(pack.StylizedNameWithRepository())
Expand Down Expand Up @@ -417,15 +417,15 @@ outer:
return nil
}

type Item struct {
type item struct {
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
PubDate string `xml:"pubDate"`
Creator string `xml:"dc:creator"`
}

func (item Item) Print(buildTime time.Time) {
func (item item) print(buildTime time.Time) {
var fd string
date, err := time.Parse(time.RFC1123Z, item.PubDate)

Expand All @@ -447,21 +447,19 @@ func (item Item) Print(buildTime time.Time) {
desc := strings.TrimSpace(parseNews(item.Description))
fmt.Println(desc)
}

return
}

type Channel struct {
type channel struct {
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
Language string `xml:"language"`
Lastbuilddate string `xml:"lastbuilddate"`
Items []Item `xml:"item"`
Items []item `xml:"item"`
}

type rss struct {
Channel Channel `xml:"channel"`
Channel channel `xml:"channel"`
}

func printNewsFeed() error {
Expand Down Expand Up @@ -491,11 +489,11 @@ func printNewsFeed() error {

if config.SortMode == BottomUp {
for i := len(rss.Channel.Items) - 1; i >= 0; i-- {
rss.Channel.Items[i].Print(buildTime)
rss.Channel.Items[i].print(buildTime)
}
} else {
for i := 0; i < len(rss.Channel.Items); i++ {
rss.Channel.Items[i].Print(buildTime)
rss.Channel.Items[i].print(buildTime)
}
}

Expand Down
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func aurInfoPrint(names []string) ([]*rpc.Pkg, error) {
return info, err
}

warnings.Print()
warnings.print()

return info, nil
}
2 changes: 1 addition & 1 deletion upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func upgradePkgs(aurUp, repoUp upSlice) (stringSet, stringSet, error) {
sort.Sort(aurUp)
allUp := append(repoUp, aurUp...)
fmt.Printf("%s"+bold(" %d ")+"%s\n", bold(cyan("::")), allUpLen, bold("Packages to upgrade."))
allUp.Print()
allUp.print()

fmt.Println(bold(green(arrow + " Packages to not upgrade: (eg: 1 2 3, 1-3, ^4 or repo name)")))
fmt.Print(bold(green(arrow + " ")))
Expand Down

0 comments on commit 3f15788

Please sign in to comment.