本文整理匯總了Golang中github.com/hashicorp/otto/helper/schema.FieldData.GetOk方法的典型用法代碼示例。如果您正苦於以下問題:Golang FieldData.GetOk方法的具體用法?Golang FieldData.GetOk怎麽用?Golang FieldData.GetOk使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/hashicorp/otto/helper/schema.FieldData
的用法示例。
在下文中一共展示了FieldData.GetOk方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: processDevDep
func (c *customizations) processDevDep(d *schema.FieldData) error {
if _, ok := d.GetOk("vagrantfile"); !ok {
return nil
}
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDevDep(d))
return nil
}
示例2: processDeploy
func (c *customizations) processDeploy(d *schema.FieldData) error {
tf, ok := d.GetOk("terraform")
if !ok {
return nil
}
c.Opts.Bindata.Context["deploy_terraform_path"] = tf.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDeploy(d))
return nil
}
示例3: processBuild
func (c *customizations) processBuild(d *schema.FieldData) error {
p, ok := d.GetOk("packer")
if !ok {
return nil
}
c.Opts.Bindata.Context["build_packer_path"] = p.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomBuild(d))
return nil
}
示例4: processDev
func (c *customizations) processDev(d *schema.FieldData) error {
p, ok := d.GetOk("vagrant")
if !ok {
return nil
}
c.Opts.Bindata.Context["dev_vagrant_path"] = p.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDev(d))
return nil
}
示例5: process
func (c *customizations) process(d *schema.FieldData) error {
if p, ok := d.GetOk("packer"); ok {
c.Opts.Bindata.Context["build_packer_path"] = p.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomBuild(d))
}
if tf, ok := d.GetOk("terraform"); ok {
c.Opts.Bindata.Context["deploy_terraform_path"] = tf.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDeploy(d))
}
if p, ok := d.GetOk("dev_vagrantfile"); ok {
c.Opts.Bindata.Context["dev_vagrant_path"] = p.(string)
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDev(d))
}
if _, ok := d.GetOk("dep_vagrantfile"); ok {
c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDevDep(d))
}
return nil
}