alibaba / git-repo-go

git-repo is a command-line tool for centralized workflow, can work with Gerrit, AGit-Flow compatible servers. It is written in Golang, and it can be installed easily without further dependency. It provides an easy-to-use solution for multiple repositories which is introduced by Android repo first, and it can also work with a single repository.
https://git-repo.info/
Apache License 2.0
262 stars 60 forks source link

After load manifests, check and fixup missing attrs #29

Closed jiangxin closed 3 years ago

jiangxin commented 3 years ago

Check and fixup missing attributes after load manifests.

Reported-by: zoujunhua zoujunhua86@gmail.com Signed-off-by: Jiang Xin zhiyou.jx@alibaba-inc.com

Jiu2015 commented 3 years ago

每一种类型的 name 都做了一次判断,有一些麻烦,能否定义一个自定义类型的 Name,并实现 xml 的 marshal 接口的方法,在方法中进行判断,可能会更通用一些。

type Name string

func (n *Name)  MarshalXML(e *xml.Encoder, start xml.StartElement){
 xxxx
}

以上仅供参考