浏览代码

Unexport functions and structures

Jguer 7 年之前
父节点
当前提交
3f15788c6a
共有 4 个文件被更改,包括 12 次插入14 次删除
  1. 1 1
      dependencies.go
  2. 9 11
      print.go
  3. 1 1
      query.go
  4. 1 1
      upgrade.go

+ 1 - 1
dependencies.go

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

+ 9 - 11
print.go

@@ -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)
 		}
 	}
 

+ 1 - 1
query.go

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

+ 1 - 1
upgrade.go

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