func GenerateRule(repo Repo) *rule.Rule {
	r := rule.NewRule("go_repository", repo.Name)
	if repo.Commit != "" {
		r.SetAttr("commit", repo.Commit)
	}
	if repo.Tag != "" {
		r.SetAttr("tag", repo.Tag)
	}
	r.SetAttr("importpath", repo.GoPrefix)
	if repo.Remote != "" {
		r.SetAttr("remote", repo.Remote)
	}
	if repo.VCS != "" {
		r.SetAttr("vcs", repo.VCS)
	}
	if repo.Version != "" {
		r.SetAttr("version", repo.Version)
	}
	if repo.Sum != "" {
		r.SetAttr("sum", repo.Sum)
	}
	if repo.Replace != "" {
		r.SetAttr("replace", repo.Replace)
	}
	return r
}
func GenerateRule(repo Repo) *rule.Rule {
	r := rule.NewRule("go_repository", repo.Name)
	if repo.Commit != "" {
		r.SetAttr("commit", repo.Commit)
	}
	if repo.Tag != "" {
		r.SetAttr("tag", repo.Tag)
	}
	r.SetAttr("importpath", repo.GoPrefix)
	if repo.Remote != "" {
		r.SetAttr("remote", repo.Remote)
	}
	if repo.VCS != "" {
		r.SetAttr("vcs", repo.VCS)
	}
	if repo.Version != "" {
		r.SetAttr("version", repo.Version)
	}
	if repo.Sum != "" {
		r.SetAttr("sum", repo.Sum)
	}
	if repo.Replace != "" {
		r.SetAttr("replace", repo.Replace)
	}
	return r
}
func GenerateRule ( repo Repo ) * rule . Rule { r := rule . NewRule ( " " , repo . Name ) if repo . Commit != " " { r . SetAttr ( " " , repo . Commit ) } if repo . Tag != " " { r . SetAttr ( " " , repo . Tag ) } r . SetAttr ( " " , repo . GoPrefix ) if repo . Remote != " " { r . SetAttr ( " " , repo . Remote ) } if repo . VCS != " " { r . SetAttr ( " " , repo . VCS ) } if repo . Version != " " { r . SetAttr ( " " , repo . Version ) } if repo . Sum != " " { r . SetAttr ( " " , repo . Sum ) } if repo . Replace != " " { r . SetAttr ( " " , repo . Replace ) } return r }
// GenerateRule returns a repository rule for the given repository that can
// be written in a WORKSPACE file.
GenerateRule returns a repository rule for the given repository that can be written in a WORKSPACE file .