本文整理匯總了Golang中github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-check.C.Log方法的典型用法代碼示例。如果您正苦於以下問題:Golang C.Log方法的具體用法?Golang C.Log怎麽用?Golang C.Log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-check.C
的用法示例。
在下文中一共展示了C.Log方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: deployWithTaffy
func (s *TaffyDeploySuite) deployWithTaffy(t *c.C, app *ct.App, github map[string]string) {
client := s.controllerClient(t)
taffyRelease, err := client.GetAppRelease("taffy")
t.Assert(err, c.IsNil)
rwc, err := client.RunJobAttached("taffy", &ct.NewJob{
ReleaseID: taffyRelease.ID,
ReleaseEnv: true,
Cmd: []string{
app.Name,
github["clone_url"],
github["ref"],
github["sha"],
},
Meta: map[string]string{
"type": "github",
"user_login": github["user_login"],
"repo_name": github["repo_name"],
"ref": github["ref"],
"sha": github["sha"],
"clone_url": github["clone_url"],
"app": app.ID,
},
})
t.Assert(err, c.IsNil)
attachClient := cluster.NewAttachClient(rwc)
var outBuf bytes.Buffer
exit, err := attachClient.Receive(&outBuf, &outBuf)
t.Log(outBuf.String())
t.Assert(exit, c.Equals, 0)
t.Assert(err, c.IsNil)
}
示例2: deployWithTaffy
func (s *TaffyDeploySuite) deployWithTaffy(t *c.C, app *ct.App, env, meta, github map[string]string) {
client := s.controllerClient(t)
taffyRelease, err := client.GetAppRelease("taffy")
t.Assert(err, c.IsNil)
args := []string{
app.Name,
github["clone_url"],
github["branch"],
github["rev"],
}
for name, m := range map[string]map[string]string{"--env": env, "--meta": meta} {
for k, v := range m {
args = append(args, name)
args = append(args, fmt.Sprintf("%s=%s", k, v))
}
}
rwc, err := client.RunJobAttached("taffy", &ct.NewJob{
ReleaseID: taffyRelease.ID,
ReleaseEnv: true,
Cmd: args,
Meta: map[string]string{
"github": "true",
"github_user": github["user"],
"github_repo": github["repo"],
"branch": github["branch"],
"rev": github["rev"],
"clone_url": github["clone_url"],
"app": app.ID,
},
})
t.Assert(err, c.IsNil)
attachClient := cluster.NewAttachClient(rwc)
var outBuf bytes.Buffer
exit, err := attachClient.Receive(&outBuf, &outBuf)
t.Log(outBuf.String())
t.Assert(exit, c.Equals, 0)
t.Assert(err, c.IsNil)
}