示例#1
0
文件: server.go 项目: calavera/gh-rel
func addNewProject(c *gin.Context) {
	nwo := strings.TrimSpace(c.PostForm("repo"))
	if nwo == "" {
		render.New(c).HTML(http.StatusOK, "add.tmpl", add{fmt.Errorf("the repository name cannot be empty")})
		return
	}

	if err := github.AddProject(nwo); err != nil {
		render.New(c).HTML(http.StatusOK, "add.tmpl", add{err})
		return
	}

	showProjects(c)
}
示例#2
0
文件: client.go 项目: calavera/gh-rel
func addProject(nwo string) error {
	return github.AddProject(nwo)
}