Unexport functions and structures

This commit is contained in:
Jguer 2018-05-20 16:17:05 +01:00
parent 6b7ee97479
commit 3f15788c6a
No known key found for this signature in database
GPG Key ID: 09754DBECF21746F
4 changed files with 12 additions and 14 deletions

View File

@ -397,7 +397,7 @@ func getDepTree(pkgs []string, warnings *aurWarnings) (*depTree, error) {
err = checkVersions(dt)
}
dt.Warnings.Print()
dt.Warnings.print()
return dt, err
}

View File

@ -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 {
@ -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())
@ -417,7 +417,7 @@ outer:
return nil
}
type Item struct {
type item struct {
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
@ -425,7 +425,7 @@ type Item struct {
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)
@ -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 {
@ -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)
}
}

View File

@ -535,7 +535,7 @@ func aurInfoPrint(names []string) ([]*rpc.Pkg, error) {
return info, err
}
warnings.Print()
warnings.print()
return info, nil
}

View File

@ -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 + " ")))