本文整理匯總了Golang中github.com/nexneo/samay/data.Project.GetName方法的典型用法代碼示例。如果您正苦於以下問題:Golang Project.GetName方法的具體用法?Golang Project.GetName怎麽用?Golang Project.GetName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/nexneo/samay/data.Project
的用法示例。
在下文中一共展示了Project.GetName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: showProject
func showProject(project *data.Project) (err error) {
fmt.Printf(" id : %s\n", project.GetShaFromName())
fmt.Printf(" name : %s\n", project.GetName())
fmt.Printf(" entries : %d\n", len(project.Entries()))
fmt.Printf(" location : %s\n", project.Location())
return nil
}
示例2: TestListProjects
func TestListProjects(t *testing.T) {
var project *data.Project
for _, project = range data.DB.Projects() {
if ok, _ := project.OnClock(); ok {
fmt.Printf("Project: %s (ticking...)\n",
project.GetName(),
)
}
}
}
示例3: moveProject
func moveProject(project, newProject *data.Project) error {
for _, entry := range project.Entries() {
entry.Project = newProject
if err := data.Save(entry); err != nil {
return err
}
}
fmt.Printf("All entries copied to project \"%s\" \n...\n", newProject.GetName())
return deleteProject(project)
}
示例4: deleteProject
func deleteProject(project *data.Project) (err error) {
var remove string
fmt.Printf(
"Remove all data for project \"%s\" ([No]/yes)? ",
project.GetName(),
)
if fmt.Scanln(&remove); remove == "yes" {
err = data.Destroy(project)
}
return
}