本文整理汇总了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
}